-
Notifications
You must be signed in to change notification settings - Fork 1
/
Sample11_add layers to a 3D scene.html
68 lines (58 loc) · 1.48 KB
/
Sample11_add layers to a 3D scene.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>向 3D 场景添加图层</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.9/esri/css/main.css">
<script src="https://js.arcgis.com/4.9/"></script>
<script>
require([
"esri/Map",
"esri/views/SceneView",
"esri/layers/FeatureLayer",
"dojo/domReady!"
], function(Map, SceneView, FeatureLayer) {
var map = new Map({
basemap:"satellite"
});
var trailheads = new FeatureLayer({
url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer"
});
map.add(trailheads);
var trails = new FeatureLayer({
url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails/FeatureServer",
// 选择要素
definitionExpression: "ELEV_GAIN < 250"
});
map.add(trails);
var parks = new FeatureLayer({
url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space/FeatureServer"
});
map.add(parks);
var view = new SceneView({
container: "viewDiv",
map: map
});
view.when(function(){
view.goTo({
center: [-118.71511,34.09042],
zoom: 11,
tilt: 70
})
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>