-
Notifications
You must be signed in to change notification settings - Fork 1
/
Sample12_Display a web scene.html
54 lines (48 loc) · 1.07 KB
/
Sample12_Display a web 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
<!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.8/esri/css/main.css">
<script src="https://js.arcgis.com/4.8/"></script>
<script>
require([
"esri/WebScene",
"esri/views/SceneView",
"esri/widgets/Legend",
"esri/widgets/ScaleBar",
"dojo/domReady!"
], function(WebScene, SceneView, Legend, ScaleBar) {
var webScene = new WebScene({
portalItem:{
id: "579f97b2f3b94d4a8e48a5f140a6639b"
}
});
var view = new SceneView({
container: "viewDiv",
map: webScene
});
var legend = new Legend({
view: view
});
view.ui.add(legend, "top-right");
var scaleBar = new ScaleBar({
view: view
});
view.ui.add(scaleBar, "bottom-left");
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>