-
Notifications
You must be signed in to change notification settings - Fork 2
/
galicia.js
87 lines (75 loc) · 3.55 KB
/
galicia.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
var allgemeinechartedeskoenigreiches_baseoverlay = null;
$(document).ready(function() {
// Initialize the map on the "map" div with a given center and zoom.
var map = L.map('map', {
center: [50.0642, 27.2900],
zoom: 6
});
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>'
});
allgemeinechartedeskoenigreiches_baseoverlay = L.tileLayer('layerdata/allgemeinechartedeskoenigreiches/{z}/{x}/{-y}.png', {
attribution: 'Historical map tiles by <a href="https://polona.pl/search/?query=Allgemeine_Charte_des_Koenigreiches_Galizien&filters=public:1">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 geojsonLayer1 = new L.GeoJSON.AJAX("geojson/austrian_galicia_1772.geojson", { style: style1 }).addTo(map);
var geojsonLayer2 = new L.GeoJSON.AJAX("geojson/austrian_bukovina_1775.geojson", { style: style2 });
var geojsonLayer3 = new L.GeoJSON.AJAX("geojson/west_galicia_1795_1809.geojson", { style: style3 });
var geojsonLayer4 = new L.GeoJSON.AJAX("geojson/removal_of_tarnopol_region_1809_1815.geojson", { style: style4 });
var geojsonLayer5 = new L.GeoJSON.AJAX("geojson/free_state_of_krakow_1815_1846.geojson", { style: style5 });
var geojsonLayer6 = new L.GeoJSON.AJAX("geojson/austrian_galicia_1846_1918.geojson", { style: style6 });
var baseMaps = {
"Stamen Toner": stamen_toner,
"Stamen Watercolor": stamen_watercolor,
"OpenStreetMap": osm,
};
var overlayMaps = {
"General": {
"Allgemeine Charte des Koenigreiches Galizien": allgemeinechartedeskoenigreiches_baseoverlay,
},
"Views of Galicia": {
"Austrian Galicia 1772": geojsonLayer1,
"Austrian Bukovina 1775": geojsonLayer2,
"West Galicia 1795-1809": geojsonLayer3,
"Removal of the Tarnopol Region 1809-1815": geojsonLayer4,
"Free State of Krakow 1815-1846": geojsonLayer5,
"Austrian Galicia and Bukovina 1846-1918": geojsonLayer6,
},
};
L.control.groupedLayers(baseMaps, overlayMaps, {collapsed:false}).addTo(map);
// Really hacky opacity slider.
$("span:contains('Allgemeine Charte des Koenigreiches')").html(' Allgemeine Charte des Koenigreiches Galizien<br/><input id="slide" type="range" min="0" max="1" step="0.1" value="1.0" oninput="allgemeinechartedeskoenigreiches_baseoverlay.setOpacity(this.value)">');
});