-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
74 lines (61 loc) · 2.29 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Eesti haldusjaotus</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link rel='stylesheet' href='https://unpkg.com/[email protected]/dist/leaflet.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.0/gh-fork-ribbon.min.css" />
<script src='https://unpkg.com/[email protected]/dist/leaflet.js'></script>
<script src='https://unpkg.com/[email protected]/leaflet-omnivore.min.js'></script>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.github-fork-ribbon.left-bottom:before {
background-color: #333;
}
</style>
</head>
<body>
<div id='map'></div>
<a class="github-fork-ribbon left-bottom fixed" href="https://github.com/buildig/EHAK" title="Source: buildig/EHAK">Source: buildig/EHAK</a>
<script>
var map = new L.Map('map');
var positron = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
attribution: '© <a href="http://cartodb.com/attributions">CartoDB</a>'
}).addTo(map);
function eachLayer(ay) {
var ayFeature = ay.toGeoJSON();
if (ayFeature.properties && ayFeature.properties.ANIMI) {
ay.bindPopup('<b>' + ayFeature.properties.ANIMI + '</b></br>' + ayFeature.properties.ONIMI + '</br>' + ayFeature.properties.MNIMI + '</br>Pindala: ' + (ayFeature.properties.AREA / 1000000).toFixed(2) + ' km<sup>2</sup>');
}
}
var ayLayer = L.geoJson(null, {
style: {
color: 'orange',
weight: 1,
fillOpacity: 0.1
},
smoothFactor: 0.5,
attribution: '© <a href="http://geoportaal.maaamet.ee/eng/Maps-and-Data/Administrative-and-Settlement-Division-p312.html">Maa-amet</a>'
});
var asustusyksus = omnivore.geojson('https://rawgit.com/buildig/EHAK/master/geojson/asustusyksus.json', null, ayLayer)
.on('ready', function() {
map.fitBounds(asustusyksus.getBounds());
map.addLayer(asustusyksus);
asustusyksus.eachLayer(eachLayer);
});
asustusyksus.on('click', function(e) {
map.fitBounds(e.layer.getBounds());
});
</script>
</body>
</html>