Skip to content

Instantly share code, notes, and snippets.

@elijahzarlin
Last active July 30, 2019 06:37
Show Gist options
  • Save elijahzarlin/3a651ff18d45e164bbae3b3c7ac9ea7b to your computer and use it in GitHub Desktop.
Save elijahzarlin/3a651ff18d45e164bbae3b3c7ac9ea7b to your computer and use it in GitHub Desktop.
map.addSource('radar-data', {
type: 'vector',
url: 'mapbox://examples.dwtmhwpu'
});
map.addLayer({
"id": "radarpolygon",
"type": "fill",
"source": "raddar-data",
"source-layer": "0",
"filter": ["==", "idx", 0],
'layout': {
"visibility": "visible"
},
'paint': {
'fill-opacity': 0.7,
'fill-color': [
"step",
["get", "value"],
"hsl(0, 0%, 100%)", 8,
"hsl(202, 88%, 51%)", 18,
"hsl(194, 88%, 51%)", 36,
"hsl(185, 88%, 51%)", 54,
"hsl(177, 96%, 53%)", 72,
"hsl(157, 96%, 53%)", 90,
"hsl(101, 94%, 65%)", 108,
"hsl(60, 100%, 49%)", 126,
"hsl(43, 100%, 49%)", 144,
"hsl(26, 100%, 49%)", 162,
"hsl(10, 100%, 49%)", 180,
"hsl(0, 64%, 43%)", 198,
"hsl(326, 47%, 29%)", 216,
"hsl(274, 47%, 29%)", 234,
"hsl(246, 56%, 35%)"
]
}
}, 'place-village');
@xiaofsu
Copy link

xiaofsu commented Jul 30, 2019

Is the source id incorrect? Can you add Layer 'place-village'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment