-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
contour-layer.html
47 lines (42 loc) · 1.28 KB
/
contour-layer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<title>deck.gl ContourLayer Example</title>
<script src="https://unpkg.com/deck.gl@^9.0.0/dist.min.js"></script>
<script src='https://unpkg.com/maplibre-gl@3.6.0/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@3.6.0/dist/maplibre-gl.css' rel='stylesheet' />
<style type="text/css">
body {
width: 100vw;
height: 100vh;
margin: 0;
}
</style>
</head>
<body></body>
<script type="text/javascript">
const {DeckGL, ContourLayer} = deck;
new DeckGL({
mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json',
initialViewState: {
longitude: -119.3,
latitude: 35.6,
zoom: 6,
maxZoom: 20
},
controller: true,
layers: [
new ContourLayer({
id: 'contourLayer',
data:
'https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/screen-grid/ca-transit-stops.json',
getPosition: d => d,
contours: [
{threshold: 1, color: [255, 0, 0], strokeWidth: 4},
{threshold: 5, color: [0, 255, 0], strokeWidth: 2},
{threshold: [6, 10], color: [0, 0, 255, 128]}
]
})
]
});
</script>
</html>