-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.js
34 lines (29 loc) · 1.23 KB
/
map.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
var map = L.map('map').setView([60.185, 24.83], 10);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.name && feature.properties.address && feature.properties.rhs) {
layer.bindPopup(
'<strong>' + feature.properties.name + '</strong><br>' +
feature.properties.address + '<br>' +
'<a href="' + feature.properties.rhs + '" target="_blank">Rakennushistoriaselvitys</a>' + '<br>' +
'<a href="https://web.archive.org/' + feature.properties.rhs + '" target="_blank">Rakennushistoriaselvitys (arkistoitu)</a>'
);
}
}
L.geoJSON(rakennushistoria, {onEachFeature: onEachFeature}).addTo(map); // Add GeoJSON layer
/*
// A button for getting coordinates visible by clicking on the map
function enableAdminmode() {
var popup = L.popup();
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent("Tämä pisteen WGS84-koordinaatit: " + e.latlng.toString())
.openOn(map);
}
map.on('click', onMapClick);
}
*/