-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
boiler-plate-arcgis.html
52 lines (47 loc) · 1.42 KB
/
boiler-plate-arcgis.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
48
49
50
51
52
<html>
<head>
<title>Get Started with deck.gl and ArcGIS</title>
<script src="https://unpkg.com/deck.gl@^8.1.0/dist.min.js"></script>
<script src="https://unpkg.com/@deck.gl/arcgis@^8.1.0/dist.min.js"></script>
<script src="https://js.arcgis.com/4.14/"></script>
<link rel="stylesheet" href="https://js.arcgis.com/4.14/esri/themes/light/main.css"/>
</head>
<body style="margin:0;">
<div id="container" style="width: 100vw; height: 100vh;"></div>
</body>
<script type="text/javascript">
const {loadArcGISModules, ScatterplotLayer, TextLayer} = deck;
loadArcGISModules(['esri/Map', 'esri/views/MapView']).then(({DeckLayer, modules}) => {
const [ArcGISMap, MapView] = modules;
const layer = new DeckLayer({
'deck.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
})
]
});
const mapView = new MapView({
container: 'container',
map: new ArcGISMap({
basemap: 'gray-vector',
layers: [layer]
}),
center: [-122.45, 37.78],
zoom: 11
});
});
</script>
</html>