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
Bug Report: moveend Event Triggered by zoomToBounds Even Without Bounds Change
Description:
The moveend event is being fired when calling zoomToBounds even though the map's visible bounds have not changed. This behavior is causing unnecessary updates and performance issues.
Steps to Reproduce:
Create a map with clusters using Leaflet.markercluster.
Call the zoomToBounds method on a cluster.
Observe that the moveend event is fired even if the map's visible bounds remain the same.
Expected Behavior:
The moveend event should only be fired when the map's visible bounds have actually changed.
Suggested Fix:
Modify the _moveEnd method in src/MarkerClusterGroup.js to check if the map's visible bounds have actually changed before performing updates.
_moveEnd: function(){if(this._inZoomAnimation){return;}varnewBounds=this._getExpandedVisibleBounds();// Check if the map has visibly movedif(!this._currentShownBounds.equals(newBounds)){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,newBounds);this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),newBounds);this._currentShownBounds=newBounds;}};
The text was updated successfully, but these errors were encountered:
Karan9615-off
changed the title
Issue: moveend Event Firing During Spiderfying (Bounds not changed)
Issue: moveend Event Triggered by zoomToBounds Even Without Bounds Change
Jan 14, 2025
Bug Report:
moveend
Event Triggered byzoomToBounds
Even Without Bounds ChangeDescription:
The
moveend
event is being fired when callingzoomToBounds
even though the map's visible bounds have not changed. This behavior is causing unnecessary updates and performance issues.Steps to Reproduce:
zoomToBounds
method on a cluster.moveend
event is fired even if the map's visible bounds remain the same.Expected Behavior:
The
moveend
event should only be fired when the map's visible bounds have actually changed.Suggested Fix:
Modify the
_moveEnd
method insrc/MarkerClusterGroup.js
to check if the map's visible bounds have actually changed before performing updates.JS Fiddle:
Please look into this https://jsfiddle.net/4r8k9hLj/14/.
Example Code:
The text was updated successfully, but these errors were encountered: