-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
86 lines (82 loc) · 2.23 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Custom Recenter Widget - 4.14</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.14/esri/themes/light/main.css" />
<link rel="stylesheet" href="app/styles/main.css">
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
.recenter-tool {
padding: 2em;
width: 150px;
height: 50px;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.recenter-tool > p {
margin: 0;
}
</style>
<script>
var locationPath = location.pathname.replace(/\/[^\/]+$/, "");
window.dojoConfig = {
packages: [
{
name: "app",
location: locationPath + "/app"
}
]
};
</script>
<script src="https://js.arcgis.com/4.14/"></script>
<script>
var map, recenter, view;
require(["esri/Map", "esri/views/MapView", "app/SwitchExtent", "esri/layers/VectorTileLayer"], function(
Map,
MapView,
SwitchExtent,
VectorTileLayer
) {
map = new Map({
basemap: "gray-vector"
});
var tileLayer = new VectorTileLayer({
url:
"https://www.arcgis.com/sharing/rest/content/items/92c551c9f07b4147846aae273e822714/resources/styles/root.json"
});
map.add(tileLayer);
view = new MapView({
container: "viewDiv",
map: map,
center: [-100.33, 43.69],
zoom: 4
});
/*
view.when(function() {
switchExtent = new SwitchExtent({
view: view,
count: 10
});
*/
switchExtent = new SwitchExtent({
view: view,
count: 10
});
view.ui.add(switchExtent, "top-right");
//});
});
</script>
</head>
<body>
<div id="viewDiv" class="esri-widget"></div>
</body>
</html>