forked from MattMills/eet-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
galicia.js
93 lines (78 loc) · 3.46 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
88
89
90
91
92
93
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
});
map.attributionControl.addAttribution('<a href="http://easteurotopo.org/">Topographic Maps of Eastern Europe</a>');
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 esri = L.esri.Vector.vectorTileLayer("https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer").addTo(map);
// var esri = L.esri.Vector.vectorBasemapLayer("3d1a30626bbc46c582f148b9252676ce", {
// apikey: "AAPK2ecec03a68c5440e8fe1a97f287e7a09DEA8y3v-_GEpeBxyjr1Y3sR4hFj_U8veDpkxhO9e-qFGeV4gyCYd84mQkJq6smah", // provide either apikey or token
// }).addTo(map);
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 = {
// "National Geographic Style": esri,
"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)">');
$('.leaflet-control-layers').hide();
$('.leaflet-control-layers').css('top','30px');
btn.onclick = function() {
$('.leaflet-control-layers').toggle();
}
});