-
Notifications
You must be signed in to change notification settings - Fork 39
/
app.js
executable file
·34 lines (29 loc) · 1.07 KB
/
app.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
// Initialize leaflet.js
var L = require('leaflet');
var S = require('leaflet.sync')
var map_center = [47.807993, 13.056945];
// Base layers
var esri_WorldImagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
});
var esri_NatGeoWorldMap = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC',
maxZoom: 16
});
// Initialize the both maps
var map_1 = L.map('map_1', {
layers:[esri_WorldImagery],
scrollWheelZoom: false,
center: map_center,
zoom: 10
});
map_1.attributionControl.setPrefix('');
var map_2 = L.map('map_2', {
layers:[esri_NatGeoWorldMap],
scrollWheelZoom: false,
center: map_center,
zoom: 10
});
// Sync them
map_1.sync(map_2);
map_2.sync(map_1);