-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
boiler-plate.html
44 lines (39 loc) · 1.17 KB
/
boiler-plate.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
<html>
<head>
<title>Get Started with deck.gl and Mapbox</title>
<script src="https://unpkg.com/deck.gl@^8.0.0/dist.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.4.0/mapbox-gl.js"></script>
</head>
<body style="margin:0; width: 100vw; height: 100vh;"></body>
<script type="text/javascript">
const {DeckGL, ScatterplotLayer, TextLayer} = deck;
new DeckGL({
mapStyle: 'https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json',
initialViewState: {
longitude: -122.45,
latitude: 37.78,
zoom: 11,
maxZoom: 16
},
controller: true,
layers: [
new ScatterplotLayer({
data: [
{position: [-122.402, 37.79], color: [255, 0, 0], radius: 1000}
],
getPosition: d => d.position,
getFillColor: d => d.color,
getRadius: d => d.radius,
opacity: 0.3
}),
new TextLayer({
data: [
{position: [-122.402, 37.79], text: 'Hello World'}
],
getPosition: d => d.position,
getText: d => d.text
})
]
});
</script>
</html>