-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (40 loc) · 1.16 KB
/
index.js
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
let type_of_map = '';
function getImage(elem){
let selection = document.getElementById('status');
if (type_of_map !== ''){
prevButton = document.getElementById(type_of_map);
prevButton.style = 'border-left: 5px solid #8f625e;';
}
type_of_map = elem.id;
selection.innerHTML = type_of_map;
elem.style = 'border-left: 10px solid #ff1500;';
document.documentElement.scrollTop = 0;
}
require([
"esri/config",
"esri/Map",
"esri/views/MapView",
"esri/core/watchUtils",
"esri/layers/FeatureLayer",
"esri/widgets/FeatureTable"
], function (
esriConfig,
Map,
MapView) {
esriConfig.apiKey = /* "YOUR API KEY HERE" */;
const map = new Map({
basemap: "arcgis-imagery"
});
button = document.getElementById('button-cover');
button.addEventListener('click', ()=>{
map.basemap = type_of_map;
})
// view doesnt have const keyword to make it a global var.
// this is to use it in the console to get coordinates from terminal
view = new MapView({
container: 'viewDiv',
map: map,
center: [80.98995979305177,10.301300275967641],
zoom: 6,
});
});