-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.html
69 lines (50 loc) · 2.06 KB
/
map.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Χάρτης Πολιτικής Προστασίας</title>
<link rel="stylesheet" type="text/css" href="gis_lib/leaflet.css">
<link rel="stylesheet" type="text/css" href="gis_lib/map.css">
</head>
<body>
<div id="map"></div>
<script src="gis_lib/leaflet.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function Popup(feature,layer){
var msg_fire= "ΑΠΑΓΟΡΕΥΣΗ ΚΥΚΛΟΦΟΡΙΑΣ - ΥΨΗΛΟ ΕΠΙΠΕΔΟ ΚΙΝΔΥΝΟΥ ";
var icon_fire="<img src='flame.png' width='30' height='30'></img>";
layer.bindPopup("<center> <b>" + feature.properties.name + "</b></center>" + msg_fire + icon_fire);
}
var mystyle={
"color":"red",
"opacity":0.3
}
var map = L.map('map').setView([37.5190, 22.4217], 10);
mapLink =
'<a href="http://openstreetmap.org">OpenStreetMap</a>';
L.tileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © ' + mapLink,
maxZoom: 18,
}).addTo(map);
var states=["arcadia.geojson","lakonia.geojson","messinia.geojson","argolida.geojson","korinthia.geojson"];
for (var index in states){
$.getJSON(states[index], function(area) {
L.geoJson(area,{
onEachFeature:Popup,
style:mystyle
}).addTo(map);
});
}
/*
$.getJSON('new_arcadia.geojson', function(arcadia) {
L.geoJson(arcadia,{
onEachFeature:Popup,
style:mystyle
}).addTo(map);
});
*/
</script>
</body>
</html>