forked from MattMills/eet-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
romania1914.js
98 lines (82 loc) · 2.93 KB
/
romania1914.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
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
var romania_baseoverlay = null;
$(document).ready(function() {
// Initialize the map on the "map" div with a given center and zoom.
var map = L.map('map', {
center: [46.225, 27.422],
zoom: 7
});
map.attributionControl.addAttribution('<a href="http://easteurotopo.org/">Topographic Maps of Eastern Europe</a>');
var hash = new L.Hash(map);
var Esri_NatGeoWorldMap = L.tileLayer('https://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
}).addTo(map);
var USGS_USImageryTopo = L.tileLayer.fallback('https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/{z}/{y}/{x}', {
maxZoom: 20,
attribution: 'Tiles courtesy of the <a href="https://usgs.gov/">U.S. Geological Survey</a>'
});
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors'
});
romania_baseoverlay = L.tileLayer('layerdata/romania1914/{z}/{x}/{-y}.png', {
attribution: 'Historical map tiles by <a href="http://etomesto.ru/">http://etomesto.ru/</a>'
}).addTo(map);
var style1 = {
"color": "#F4630E",
"weight": 3,
};
var style2 = {
"color": "#0F0FDA",
"weight": 3,
};
var style3 = {
"color": "#F10683",
"weight": 3,
};
var style4 = {
"color": "#F50B4D",
"weight": 3,
};
var style5 = {
"color": "#F56905",
"weight": 3,
};
var style6 = {
"color": "#3410E9",
"weight": 3,
};
var style7 = {
"color": "#8A2BE2",
"weight": 3,
};
var yellowIcon = new L.Icon({
iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-yellow.png',
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
shadowSize: [41, 41]
});
var geojsonLayer1 = new L.GeoJSON.AJAX("geojson/romania-1914-towns.geojson", {}).addTo(map);
var baseMaps = {
"Esri.NatGeoWorldMap": Esri_NatGeoWorldMap,
"OpenStreetMap": osm,
"USGS.USImageryTopo": USGS_USImageryTopo,
};
var overlayMaps = {
"General": {
"Base": romania_baseoverlay,
},
"Romania": {
"Jewish communities of Romania": geojsonLayer1,
},
};
L.control.groupedLayers(baseMaps, overlayMaps, {collapsed:false}).addTo(map);
// Really hacky opacity slider.
$("span:contains('Base')").html(' Base<br/><input id="slide" type="range" min="0" max="1" step="0.1" value="1.0" oninput="romania_baseoverlay.setOpacity(this.value)">');
$('.leaflet-control-layers').hide();
$('.leaflet-control-layers').css('top','30px');
btn.onclick = function() {
$('.leaflet-control-layers').toggle();
}
});