Revize 70a3df53
Přidáno uživatelem Jakub Vašta před asi 4 roky(ů)
website/public/js/zcu-heatmap.js | ||
---|---|---|
17 | 17 |
var isAnimationRunning = false |
18 | 18 |
var data = [] |
19 | 19 |
|
20 |
var info = [] |
|
21 |
var currenInfo = 0 |
|
22 |
|
|
20 | 23 |
// holds all instances of markers for bind/unbind popup purpose |
21 | 24 |
// contains: {key:[L.circle,L.pupup]} |
22 | 25 |
// key: x and y, x + '' + y string |
... | ... | |
51 | 54 |
${genPopUpControls([previousButton, posInfo, nextButton])} |
52 | 55 |
` |
53 | 56 |
} |
57 |
/** |
|
58 |
* Initialize leaflet map on start position which can be default or set based on user action |
|
59 |
*/ |
|
54 | 60 |
// eslint-disable-next-line no-unused-vars |
55 | 61 |
function initMap () { |
56 | 62 |
startX = localStorage.getItem('lat') || startX |
... | ... | |
67 | 73 |
mymap.on('click', showInfo) |
68 | 74 |
} |
69 | 75 |
|
70 |
var info = [] |
|
71 |
var currenInfo = 0 |
|
72 | 76 |
|
73 | 77 |
function showInfo (e) { |
74 | 78 |
info = [] |
... | ... | |
137 | 141 |
mymap.setView([latitude, longitude], zoom) |
138 | 142 |
} |
139 | 143 |
|
144 |
/** |
|
145 |
* Change animation start from playing to stopped or the other way round |
|
146 |
*/ |
|
140 | 147 |
// eslint-disable-next-line no-unused-vars |
141 | 148 |
function changeAnimationState () { |
142 | 149 |
isAnimationRunning = !isAnimationRunning |
... | ... | |
173 | 180 |
changeUrl() |
174 | 181 |
} |
175 | 182 |
|
183 |
/** |
|
184 |
* Change browser url based on animation step |
|
185 |
*/ |
|
176 | 186 |
function changeUrl () { |
177 | 187 |
window.history.pushState( |
178 | 188 |
'', |
... | ... | |
190 | 200 |
$('#timeline').attr('class', 'time hour-' + currentTime) |
191 | 201 |
} |
192 | 202 |
|
203 |
/** |
|
204 |
* Load and display heatmap layer for current data |
|
205 |
* @param {string} opendataRoute route to dataset source |
|
206 |
* @param {string} positionsRoute route to dataset postitions source |
|
207 |
*/ |
|
193 | 208 |
// eslint-disable-next-line no-unused-vars |
194 | 209 |
function loadCurrentTimeHeatmap (opendataRoute, positionsRoute) { |
195 | 210 |
dataSourceRoute = opendataRoute |
... | ... | |
292 | 307 |
// $(.leaflet-heatmap-layer).css('opacity', 'value'); |
293 | 308 |
} |
294 | 309 |
|
310 |
/** |
|
311 |
* Checks dataset availibility |
|
312 |
* @param {string} route authority for datasets availibility checks |
|
313 |
*/ |
|
295 | 314 |
// eslint-disable-next-line no-unused-vars |
296 | 315 |
function checkDataSetsAvailability (route) { |
297 | 316 |
$.ajax({ |
Také k dispozici: Unified diff
+ Re #8086
+ php refactoring and comments