Skip to content

Instantly share code, notes, and snippets.

@mladenp
Created December 20, 2018 00:29
Show Gist options
  • Save mladenp/8fb6810bd21b4405083328b7197b4001 to your computer and use it in GitHub Desktop.
Save mladenp/8fb6810bd21b4405083328b7197b4001 to your computer and use it in GitHub Desktop.
Tangram example point labels
sources:
tz2:
type: GeoJSON
url: https://gist.githubusercontent.com/mladenp/469a49559f566ad46e65281fe0e4f9cb/raw/8f1a3421f299fa014107c49ff6de0f9473281d4b/MultiPolygon.geojson
generate_label_centroids: true
max_zoom: 21
min_zoom: 1
tz3:
type: GeoJSON
url: https://gist.githubusercontent.com/mladenp/6aa115072598f2e6fee06a2268b5c239/raw/efd865732af34f8465f9b5923ca6a39df0db7f99/gjtest.geojson
generate_label_centroids: true
max_zoom: 21
min_zoom: 1
nextzen:
type: TopoJSON
url: https://tile.nextzen.org/tilezen/vector/v1/all/{z}/{x}/{y}.topojson
layers:
tz2:
data: { source: tz2 }
enabled: true
draw:
lines:
color: red
width: 2px
order: 10
labels:
filter: { label_placement: true }
draw:
text:
text_source: name
font:
family: Helvetica
fill: red
size: [[8,24px],[17,24px]]
weight: bold
stroke:
color: blue
width: 2
tz3:
data: { source: tz3 }
enabled: true
draw:
points:
size: 20px
color: red
labels:
draw:
text:
text_source: name
font:
family: Helvetica
fill: red
size: [[8,24px],[17,24px]]
weight: bold
stroke:
color: blue
width: 2
water:
data: { source: nextzen }
draw:
polygons:
order: 2
color: '#353535'
earth:
data: { source: nextzen }
draw:
polygons:
order: 1
color: '#555555'
landuse:
data: { source: nextzen }
draw:
polygons:
order: 3
color: '#666666'
roads:
data: { source: nextzen}
filter: { not: { kind: [rail, ferry] } }
draw:
lines:
order: 4
color: '#ffffff'
width: [[7,0.0px], [10, .5px], [15, .75px], [17, 5m]]
highway:
filter: { kind: highway }
draw:
lines:
order: 5
width: [[8,0px], [8,.25px], [11, 1.5px], [14, 2px], [16, 4px], [17, 10m]]
link:
filter: { is_link: true } # on- and off-ramps, etc
draw:
lines:
width: [[8,0px], [14, 3px], [16, 5px], [18, 10m]]
tunnel-link:
filter: {is_tunnel: true, $zoom: {min: 13} }
tunnel:
filter: {is_tunnel: true }
draw:
lines:
order: 6
buildings:
data: { source: nextzen }
draw:
polygons:
order: 7
color: '#999999'
extrude: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment