forked from MattMills/eet-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kingdom-of-hungary.js
96 lines (80 loc) · 3.15 KB
/
kingdom-of-hungary.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
var kingdomofhungary_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.965, 21.418],
zoom: 7
});
map.attributionControl.addAttribution('<a href="http://easteurotopo.org/">Topographic Maps of Eastern Europe</a>');
var hash = new L.Hash(map);
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors'
}).addTo(map);
var stamen_watercolor = L.tileLayer('http://tile.stamen.com/watercolor/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'
});
var stamen_toner = L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>'
});
kingdomofhungary_baseoverlay = L.tileLayer('layerdata/kingdomofhungary/{z}/{x}/{-y}.png', {
attribution: 'Historical map tiles by <a href="http://hungaricana.hu/">http://hungaricana.hu/</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/jewish_communities_of_hungary.geojson", {}).addTo(map);
var baseMaps = {
"Stamen Toner": stamen_toner,
"Stamen Watercolor": stamen_watercolor,
"OpenStreetMap": osm,
};
var overlayMaps = {
"General": {
"Base": kingdomofhungary_baseoverlay,
},
"Jews in Hungary": {
"Jewish communities of Hungary": 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="kingdomofhungary_baseoverlay.setOpacity(this.value)">');
$('.leaflet-control-layers').hide();
$('.leaflet-control-layers').css('top','30px');
btn.onclick = function() {
$('.leaflet-control-layers').toggle();
}
});