-
Notifications
You must be signed in to change notification settings - Fork 1
/
moscow_5.html
109 lines (92 loc) · 2.9 KB
/
moscow_5.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<html>
<head>
<title>Example 4</title>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="moscow_ice_fields.js"></script>
<script src="http://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster.js"></script>
<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.css" />
<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.css" />
<link rel="stylesheet" href="http://humangeo.github.io/leaflet-dvf/dist/css/dvf.css" type="text/css" />
<script type="text/javascript" src="http://humangeo.github.io/leaflet-dvf/dist/leaflet-dvf.min.js"></script>
</head>
<body>
<div id="map" style="height: 100%;"> </div>
<script>
var map = L.map('map').setView([55.75, 37.63], 10);
L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png',
{maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>', id: 'examples.map-i875mjb7'
}).addTo(map);
L.marker([55.75, 37.617]).addTo(map)
.bindPopup('Тут хорошо')
.openPopup();
var markers = L.markerClusterGroup();
var bool2Int = function(value) {
if(value === "Да" || value === "да") {
return 10;}
else {
return 2;
}
};
var getOptions = function(i) {
return options;
};
for(var i=0; i<iceFields.length; i++) {
var options = {
data: {
'WiFi': bool2Int(iceFields[i].Cells.ObjectHasWifi),
'Cafe': bool2Int(iceFields[i].Cells.ObjectHasEatery),
'WC': bool2Int(iceFields[i].Cells.ObjectHasToilet)
},
chartOptions: {
'WiFi': {
fillColor: '#4A7FFB',
color: '#4A7FFB',
minValue: 2,
maxValue: 10,
maxHeight: 20,
displayText: function() {
return iceFields[i].Cells.ObjectHasWifi;
}
},
'Cafe': {
fillColor: '#05F020',
color: '#05F020',
minValue: 2,
maxValue: 10,
maxHeight: 20,
displayText: function() {
return iceFields[i].Cells.ObjectHasEatery;
}
},
'WC': {
fillColor: '#F09F13',
color:'#F09F13',
minValue: 2,
maxValue: 10,
maxHeight: 20,
displayText: function() {
return iceFields[i].Cells.ObjectHasToilet;
}
}
},
weight: 1,
radius: 4,
fillOpacity: 0.7,
rotation: 0.0,
position: {
x: 0,
y: 0
},
offset: 0,
width: 12
};
var marker = new L.BarChartMarker(new L.LatLng(iceFields[i].Lat, iceFields[i].Lon),
options).addTo(map);
};
</script>
</body></html>