|
@@ -1,4 +1,4 @@
|
1
|
|
-widths = [12, 13, 14, 15, 16, 16, 16, 16];
|
|
1
|
+widths = [12, 13, 13, 13, 13, 13, 13, 13];
|
2
|
2
|
opas = [0.8, 0.6, 0.5, 0.5, 0.4];
|
3
|
3
|
mwidths = [1, 1, 1, 1.5, 2, 3, 5, 6, 6, 4, 3, 2];
|
4
|
4
|
|
|
@@ -31,7 +31,7 @@ function marker(stat, z) {
|
31
|
31
|
}
|
32
|
32
|
|
33
|
33
|
function poly(group, z) {
|
34
|
|
- var style = {color: "#85f385", smoothFactor : 0.4, fillOpacity:0.2, id : group.id};
|
|
34
|
+ var style = {color: "#85f385", smoothFactor : 0.4, fillOpacity: 0.2, id : group.id};
|
35
|
35
|
if (group.new) {
|
36
|
36
|
style.color = "blue";
|
37
|
37
|
}
|
|
@@ -44,15 +44,12 @@ function poly(group, z) {
|
44
|
44
|
}
|
45
|
45
|
|
46
|
46
|
function sugArr(sug, z) {
|
47
|
|
- return [
|
48
|
|
- L.polyline(sug.arrow, {id : sug.id, color: 'black', smoothFactor : 1, weight: 2, opacity:0.5}),
|
49
|
|
- L.polyline(sug.arrow, {id : sug.id, color: 'blue', smoothFactor : 1, weight: 1, opacity:0.5})
|
50
|
|
- ]
|
51
|
|
- ;
|
|
47
|
+ return L.polyline(sug.arrow, {id : sug.id, color: 'blue', smoothFactor : 0.1, weight: 4, opacity:0.5});
|
52
|
48
|
}
|
53
|
49
|
|
54
|
|
-function renderStat(stat, ll) {
|
|
50
|
+function renderStat(stat) {
|
55
|
51
|
var attrrows = {};
|
|
52
|
+ var ll = {lat: stat.lat, lon: stat.lon};
|
56
|
53
|
|
57
|
54
|
var content = document.createElement('div');
|
58
|
55
|
content.setAttribute("id", "nav")
|
|
@@ -135,13 +132,12 @@ function renderStat(stat, ll) {
|
135
|
132
|
.openOn(map);
|
136
|
133
|
}
|
137
|
134
|
|
138
|
|
-
|
139
|
|
-function openStat(id, ll) {
|
|
135
|
+function openStat(id) {
|
140
|
136
|
var xmlhttp = new XMLHttpRequest();
|
141
|
137
|
xmlhttp.onreadystatechange = function() {
|
142
|
138
|
if (this.readyState == 4 && this.status == 200) {
|
143
|
139
|
var content = JSON.parse(this.responseText);
|
144
|
|
- renderStat(content, ll);
|
|
140
|
+ renderStat(content);
|
145
|
141
|
}
|
146
|
142
|
};
|
147
|
143
|
|
|
@@ -251,7 +247,6 @@ L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x
|
251
|
247
|
id: 'mapbox.streets'
|
252
|
248
|
}).addTo(map);
|
253
|
249
|
|
254
|
|
-
|
255
|
250
|
var layer = L.featureGroup().addTo(map);
|
256
|
251
|
var labelLayer = L.featureGroup().addTo(map);
|
257
|
252
|
|
|
@@ -274,9 +269,9 @@ function render() {
|
274
|
269
|
var rad = 25 - map.getZoom();
|
275
|
270
|
|
276
|
271
|
layer.addLayer(L.heatLayer(content.ok, {max: 500, gradient: {0: '#cbf7cb', 0.5: '#78f378', 1: '#29c329'}, minOpacity: 0.65, blur: blur, radius: rad}));
|
277
|
|
- layer.addLayer(L.heatLayer(content.sugg, {max: 500, gradient: {0: '#7f7fbd', 0.5: '#4444b3', 1: '#0606c1'}, minOpacity: 0.65, blur: blur-3, radius: rad-4}));
|
|
272
|
+ layer.addLayer(L.heatLayer(content.sugg, {max: 500, gradient: {0: '#7f7fbd', 0.5: '#4444b3', 1: '#0606c1'}, minOpacity: 0.65, blur: blur-3, radius: Math.min(12, rad-3)}));
|
278
|
273
|
|
279
|
|
- layer.addLayer(L.heatLayer(content.err, {max: 500, gradient: {0: '#f39191', 0.5: '#ff5656', 1: '#ff0000'}, minOpacity: 0.75, blur: blur-3, radius: rad-3, maxZoom: 15}));
|
|
274
|
+ layer.addLayer(L.heatLayer(content.err, {max: 500, gradient: {0: '#f39191', 0.5: '#ff5656', 1: '#ff0000'}, minOpacity: 0.75, blur: blur-3, radius: Math.min(10, rad-3), maxZoom: 15}));
|
280
|
275
|
}
|
281
|
276
|
};
|
282
|
277
|
|
|
@@ -313,13 +308,12 @@ function render() {
|
313
|
308
|
for (var i = 0; i < content.su.length; i++) {
|
314
|
309
|
sugg = content.su[i];
|
315
|
310
|
var a = sugArr(sugg, map.getZoom());
|
316
|
|
- suggs.push(a[0]);
|
317
|
|
- suggs.push(a[1]);
|
|
311
|
+ suggs.push(a);
|
318
|
312
|
}
|
319
|
313
|
|
320
|
314
|
if (map.getZoom() > 15) {
|
321
|
315
|
labelLayer.addLayer(L.featureGroup(labels));
|
322
|
|
- layer.addLayer(L.featureGroup(suggs).on('click', function(a) { openStat(a.layer.options.id, a.layer.getBounds().getCenter());}));
|
|
316
|
+ layer.addLayer(L.featureGroup(suggs).on('click', function(a) { openStat(a.layer.options.id); }));
|
323
|
317
|
}
|
324
|
318
|
|
325
|
319
|
if (map.getZoom() > 13) {
|
|
@@ -328,7 +322,7 @@ function render() {
|
328
|
322
|
|
329
|
323
|
|
330
|
324
|
layer.addLayer(L.featureGroup(stations).on('click', function(a) {
|
331
|
|
- openStat(a.layer.options.id, a.layer.getBounds().getCenter());}));
|
|
325
|
+ openStat(a.layer.options.id);}));
|
332
|
326
|
}
|
333
|
327
|
};
|
334
|
328
|
|