Revize 72a438f3
Přidáno uživatelem Jakub Vašta před asi 4 roky(ů)
website/public/js/zcu-heatmap.js | ||
---|---|---|
52 | 52 |
} |
53 | 53 |
// eslint-disable-next-line no-unused-vars |
54 | 54 |
function initMap () { |
55 |
|
|
56 |
startX = localStorage.getItem('lat') || startX; |
|
57 |
startY = localStorage.getItem('lng') || startY; |
|
58 |
startZoom = localStorage.getItem('zoom') || startZoom; |
|
59 |
|
|
55 | 60 |
mymap = L.map('heatmap').setView([startX, startY], startZoom) |
56 | 61 |
|
57 | 62 |
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
... | ... | |
125 | 130 |
} |
126 | 131 |
|
127 | 132 |
// eslint-disable-next-line no-unused-vars |
128 |
function setMapView (latitude = startX, longitude = startY, zoom = startZoom) { |
|
133 |
function setMapView (latitude, longitude, zoom) { |
|
134 |
localStorage.setItem('lat', latitude); |
|
135 |
localStorage.setItem('lng', longitude); |
|
136 |
localStorage.setItem('zoom', zoom); |
|
129 | 137 |
mymap.setView([latitude, longitude], zoom) |
130 | 138 |
} |
131 | 139 |
|
Také k dispozici: Unified diff
+ location persistence
+ last available collections
+ available collections code rework