Leaflet.SmoothMarkerBouncing
Leaflet.SmoothMarkerBouncing copied to clipboard
Bulk bouncing fails ?
If I do this on a context menu click it works perfectly ...
function indicateOnline(e) {
let marker = e.relatedTarget.repeater.marker;
marker.toggleBouncing();
}
Where as this fails ??
function refreshOnlineRepeaters() {
let arrayLength = g_MasterRepeaters.repeaters.length;
for (let i = 0; i < arrayLength; i++) {
let repeater = g_FilteredRepeaters.repeaters[i];
if (i % 20 === 0) {
repeater.marker.toggleBouncing();
}
}
}
The error is ...
Uncaught TypeError: Cannot read properties of undefined (reading 'classList')
at Object.z [as removeClass] (leaflet.js:5:24238)
at bouncing.min.js:1:7574
at Array.forEach (<anonymous>)
at B (bouncing.min.js:1:7534)
at M.value (bouncing.min.js:1:11705)
at e.bounce (bouncing.min.js:1:4226)
at e.toggleBouncing (bouncing.min.js:1:4610)
at e.refreshOnlineRepeaters (menuhandlers.js:154:20)
at HTMLAnchorElement.<anonymous> (leaflet.contextmenu.js:338:26)
at HTMLAnchorElement.o (leaflet.js:5:27827)