You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pinch-zooming on leaflet I do a clusters recalculation like so: const clusterizedMarkers = index.getClusters(clustersBounds, zoom);
The zoom has sometimes non integer values coming from Leaflet: From my console: zoom value – 8.383082795293051
At that moment, index.getClusters crashes the app as the zoom value is not an integer (which makes sense!)
The fix in that case is to change above code to: const clusterizedMarkers = index.getClusters(clustersBounds, parseInt(zoom));
I'm happy with this fix and I thought it could help other but it would most probably be better to solve this directly in "supercluster" lib...
Enjoy the weekend
The text was updated successfully, but these errors were encountered:
When pinch-zooming on leaflet I do a clusters recalculation like so:
const clusterizedMarkers = index.getClusters(clustersBounds, zoom);
The zoom has sometimes non integer values coming from Leaflet:
From my console: zoom value – 8.383082795293051
At that moment, index.getClusters crashes the app as the zoom value is not an integer (which makes sense!)
The fix in that case is to change above code to:
const clusterizedMarkers = index.getClusters(clustersBounds, parseInt(zoom));
I'm happy with this fix and I thought it could help other but it would most probably be better to solve this directly in "supercluster" lib...
Enjoy the weekend
The text was updated successfully, but these errors were encountered: