-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
259 lines (227 loc) · 7.35 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"/>
<meta name="description" content="Perbandingan Basemaps Normal dengan Basemap Lego. Basemap Lego dibuat dengan menggunakan ArcGIS JS API 4" />
<meta name="keywords" content="basemaps, arcgis js api, esri, lego basemap, lego, brick layer, perbandingan basemaps" />
<link rel="icon" href="https://spasialkan.com/wp-content/uploads/2018/03/cropped-Logo-Spasialkan-2018-Peta-Digital-dan-Webgis-Yogyakarta-Indonesia-32x32.png" sizes="32x32" />
<meta property="og:title" content="Perbandingan Basemaps Normal dengan Lego Basemaps | Spasialkan.COM" />
<meta property="og:image" content="https://spasialkan.com/wp-content/uploads/2018/03/cropped-Logo-Spasialkan-2018-Peta-Digital-dan-Webgis-Yogyakarta-Indonesia-32x32.png" />
<meta property="og:site_name" content="Normal Basemaps vs Lego Basemaps | Spasialkan.COM" />
<title>Normal vs Lego Basemaps</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.15/esri/themes/dark/main.css"/>
<script>
var locationPath = window.location.href.replace(/\/[^/]+$/, "/")
var dojoConfig = {
paths: {
layers: locationPath + "src/layers"
}
};
</script>
<script src="https://js.arcgis.com/4.15/"></script>
<style>
html,
body,
#viewDiv {
position: relative;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
/* The switch - the box around the slider */
.switch {
position: absolute;
display: inline-block;
top: 90px;
left: 15px;
width: 60px;
height: 34px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgb(0, 255, 21);
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
</style>
</head>
<body>
<div id="viewDiv">
</div>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/GroupLayer",
"esri/layers/TileLayer",
"esri/layers/GeoJSONLayer",
"esri/widgets/LayerList",
"esri/widgets/Swipe",
"esri/widgets/Expand",
"layers/BrickLayer",
"layers/palette"
],
function(
Map,
MapView,
GroupLayer, TileLayer, GeoJSONLayer,
LayerList, Swipe, Expand,
BrickLayer, palette
) {
const map = new Map({
// basemap: "satellite"
});
const worldImageLego = new BrickLayer({
layer: new TileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),
brickSize: 20,
brickStyle: "lego",
visible: true,
title: "World Imagery (LEGO)",
// filter: {
// darken: 0.25,
// saturate: 2
// }
});
map.add(worldImageLego);
const worldImage = new TileLayer({
url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
maxScale: 3000,
visible: true,
title: "World Imagery"
});
map.add(worldImage);
const worldStreetLego = new BrickLayer({
layer: new TileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"),
brickSize: 20,
brickStyle: "lego",
visible: false,
title: "World Street Map (LEGO)",
// filter: {
// saturate: 2
// }
});
map.add(worldStreetLego);
const worldStreet = new TileLayer({
url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
maxScale: 3000,
visible: false,
title: "World Street Map"
});
map.add(worldStreet);
const oceanLego = new BrickLayer({
layer: new TileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer"),
brickSize: 20,
brickStyle: "lego",
visible: false,
title: "Ocean Basemap (LEGO)",
filter: {
// darken: 0.25,
}
});
map.add(oceanLego);
const ocean = new TileLayer({
url: "https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer",
maxScale: 3000,
visible: false,
title: "Ocean Basemap"
});
map.add(ocean);
const natgeoLego = new BrickLayer({
layer: new TileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer"),
brickSize: 20,
brickStyle: "lego",
visible: false,
title: "NatGeo World Map (LEGO)",
// filter: {
// saturate: 2
// }
});
map.add(natgeoLego);
const natgeo = new TileLayer({
url: "https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",
maxScale: 3000,
visible: false,
title: "NatGeo World Map"
});
map.add(natgeo);
const view = new MapView({
container: "viewDiv",
map: map,
center: [117.537237, -0.578707],
// zoom: 9,
scale: 14000000,
constraints: {
minScale: 100000000,
snapToZoom: false,
// maxZoom: 17,
// minZoom: 8
}
});
// create a layerlist and expand widget and add to the view
const layerList = new LayerList({
view: view
});
const llExpand = new Expand({
view: view,
content: layerList,
expanded: false
});
view.ui.add(llExpand, "top-right");
// create a new Swipe widget
const swipe = new Swipe({
leadingLayers: [worldStreet, worldImage, ocean, natgeo],
trailingLayers: [worldStreetLego, worldImageLego, oceanLego, natgeoLego],
direction: "horizontal", // horizontal or vertical
position: 50, // set position of widget to 50%
view: view
});
// add the widget to the view
view.ui.add(swipe);
});
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-TD4LH4X5WX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-TD4LH4X5WX');
</script>
</body>
</html>