Skip to content

Instantly share code, notes, and snippets.

@donflopez
Last active May 22, 2017 14:26
Show Gist options
  • Save donflopez/3695e852523b7fd1c2fce4ed85811a09 to your computer and use it in GitHub Desktop.
Save donflopez/3695e852523b7fd1c2fce4ed85811a09 to your computer and use it in GitHub Desktop.
cameras:
perspective:
type: perspective
vanishing_point: [0, -500]
lights:
directional1:
type: directional
direction: [.1, .5, -1]
diffuse: .7
ambient: .5
styles:
buildings:
base: polygons
animated: true
shaders:
blocks:
color: |
color.rgb *= vec3(abs(sin(worldPosition().z + u_time)));
sources:
mapzen:
type: MVT
url: https://abel.carto.com/api/v1/map/named/tpl_2c83b818_3ee4_11e7_9e4d_0e98b61680bf/1/{z}/{x}/{y}.mvt
layers:
"3139ab79-d8ad-4d8e-ab46-21cc07e0faed":
data: { source: mapzen }
draw:
polygons:
order: |
function() {return Math.round(1000/feature.st_y);}
style: buildings
animated: true
extrude: function () { return feature.height * 4; }
color: |
function () {
var h = feature.height * 8 || 20;
h = Math.min((h + 50)/ 250, .8);
h = Math.max(h, .4);
h = h + 0.2;
return [h, h, h];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment