forked from MattMills/eet-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
galizien-und-nordost-ungarn.js
102 lines (86 loc) · 3.71 KB
/
galizien-und-nordost-ungarn.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
99
100
101
102
var galizienundnordostungarn_baseoverlay = null;
$(document).ready(function() {
// Initialize the map on the "map" div with a given center and zoom.
var map = L.map('map', {
center: [49.3642, 24.5900],
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>'
});
galizienundnordostungarn_baseoverlay = L.tileLayer('layerdata/galizienundnordostungarn/{z}/{x}/{-y}.png', {
attribution: 'Historical map tiles by <a href="https://polona.pl/item/galizien-und-nordost-ungarn,MTEwNTk3NTE1/4/#info:metadata">Polish National Library</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_galicia_1916.geojson", {}).addTo(map);
var geojsonLayer2 = new L.GeoJSON.AJAX("geojson/jewish_communities_of_nothern_hungary.geojson", {
pointToLayer: function(geoJsonPoint, latlng) {
return L.marker(latlng, { icon: yellowIcon });
},
});
var baseMaps = {
"Stamen Toner": stamen_toner,
"Stamen Watercolor": stamen_watercolor,
"OpenStreetMap": osm,
};
var overlayMaps = {
"General": {
"Galizien und Nordost-Ungarn, Carl Flemming ~ 1916": galizienundnordostungarn_baseoverlay,
},
"Jewish Communities of Record in the JewishGen Gazetteer ca. 1900": {
"Jews Residing in the province of Galicia": geojsonLayer1,
"Jews Residing in northern Hungary": geojsonLayer2,
},
};
L.control.groupedLayers(baseMaps, overlayMaps, {collapsed:false}).addTo(map);
// Really hacky opacity slider.
$("span:contains('Galizien und Nordost-Ungarn, Carl Flemming ~ 1916')").html(' Galizien und Nordost-Ungarn, Carl Flemming ~ 1916<br/><input id="slide" type="range" min="0" max="1" step="0.1" value="1.0" oninput="galizienundnordostungarn_baseoverlay.setOpacity(this.value)">');
$('.leaflet-control-layers').hide();
$('.leaflet-control-layers').css('top','30px');
btn.onclick = function() {
$('.leaflet-control-layers').toggle();
}
});