-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsample-app.html
71 lines (64 loc) · 1.75 KB
/
sample-app.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.27/esri/css/main.css"
/>
<script src="https://js.arcgis.com/4.27"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/core/reactiveUtils",
"esri/layers/FeatureLayer"
], function (Map, MapView, reactiveUtils, FeatureLayer) {
const fl = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});
const map = new Map({
basemap: "topo-vector",
layers: [fl],
});
const view = new MapView({
container: "viewDiv",
map: map,
extent: {
xmin: -9177811,
ymin: 4247000,
xmax: -9176791,
ymax: 4247784,
spatialReference: 102100
}
});
/* Sample snippet to contribute */
view.whenLayerView(fl).then(function (layerView) {
reactiveUtils
.whenOnce(() => !layerView?.updating)
.then(() => {
layerView.queryFeatures().then(function (results) {
console.log(results.features);
});
});
});
/* End of: Sample snippet to contribute */
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>