Revize 55098dbb
Přidáno uživatelem Tomáš Ballák před asi 4 roky(ů)
- ID 55098dbb88feff1302dfdabf4c1c162a2f8444f2
- Rodič fa91b0c1
website/templates/heatmap.html.twig | ||
---|---|---|
24 | 24 |
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script> |
25 | 25 |
<script src="{{ asset('js/leaflet.js') }}"></script> |
26 | 26 |
<script src="{{ asset('js/leaflet-heat.js') }}"></script> |
27 |
|
|
27 |
<script src="{{ asset('js/zcu-heatmap.js') }}"></script> |
|
28 | 28 |
<script> |
29 | 29 |
|
30 |
$(document).ready(function() { |
|
31 |
|
|
32 |
var mymap = L.map('heatmap').setView([49.724, 13.352], 17); |
|
33 |
|
|
34 |
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
|
35 |
attribution: '© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>', |
|
36 |
maxZoom: 19 |
|
37 |
}).addTo(mymap); |
|
38 |
|
|
39 |
$.ajax({ |
|
40 |
type: "POST", |
|
41 |
url: "{{ path('opendata') }}", |
|
42 |
success: function(result) { |
|
43 |
heatmap(result); |
|
44 |
} |
|
45 |
}); |
|
46 |
|
|
47 |
function heatmap(points) { |
|
48 |
|
|
49 |
points = points.map(function (p) { return [p['y'], p['x'], p['number']]; }); |
|
50 |
|
|
51 |
var heat = L.heatLayer(points).addTo(mymap), |
|
52 |
draw = true; |
|
53 |
|
|
54 |
} |
|
55 |
|
|
56 |
}); |
|
57 |
|
|
30 |
initMap(); |
|
31 |
showHeatmap("{{ path('opendata', {'collectionName':'open-data-db.KOLOBEZKY31102018'}) }}"); |
|
58 | 32 |
|
59 | 33 |
</script> |
60 | 34 |
|
Také k dispozici: Unified diff
Re #7857