-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhometown.html
132 lines (108 loc) · 3.38 KB
/
hometown.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Cici's hometown</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.9/esri/css/main.css">
<script src="https://js.arcgis.com/4.9/"></script>
<!-- <script> loads the ArcGIS API for JavaScript from a CDN. When new versions of the API are released, update the version number to match the newly released version.
<link> references the main.css style sheet which contains styles specific to Esri widgets and components.
-->
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
//"require""" is provided by Dojo
require([
"esri/Map",
"esri/views/SceneView",
"esri/layers/GraphicsLayer",
"esri/Graphic"
],
function(
Map, SceneView, GraphicsLayer, Graphic
) {
var map = new Map({
basemap: "dark-gray"
//ground: "world-elevation"
// Code to create the map and view will go here
// Additional basemap options are:
// satellite, hybrid, topo, gray,
// dark-gray, oceans, osm, national-geographic.
});
// Create 3D view
var view = new SceneView({
container: "viewDiv",
// Reference to the DOM node that will contain the view
map: map,
// References the map object created in step 3
scale: 5000000, // Sets the initial scale to 1:50,000,000
center: [113.8546, 26.6228] // Sets the center point of view with lon/lat
});
/*********************
* Add graphics layer
*********************/
var graphicsLayer = new GraphicsLayer();
map.add(graphicsLayer);
/*************************
* Add a 3D point graphic
*************************/
// Pingxiang
var point = {
type: "point", // autocasts as new Point()
x: 113.8546,
y: 26.6228,
z: 1010
};
markerSymbol = {
type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
color: [255, 255, 0],
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 99, 71],
width: 2
}
};
var pointGraphic = new Graphic({
geometry: point,
symbol: markerSymbol
});
graphicsLayer.add(pointGraphic);
/****************************
* Add a 3D polyline graphic
****************************/
var polyline = {
type: "polyline", // autocasts as new Polyline()
paths: [
[113.8546, 28.6228, 0],
[113.8546, 28.6228, 1000]
]
};
lineSymbol = {
type: "simple-line", // autocasts as SimpleLineSymbol()
color: [255, 10, 40],
width: 4
};
var polylineGraphic = new Graphic({
geometry: polyline,
symbol: lineSymbol
});
graphicsLayer.add(polylineGraphic);
/***************************
* Add a 3D polygon graphic
***************************/
});
</script>
</head>
<body>
<!--Define the page content-->
<div id="viewDiv"></div>
</body>
</html>