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
{{ message }}
Repository navigation
TypeError: undefined is not an object (evaluating 'projection.fromLatLngToDivPixel') #910
When calling clearMarkers/addMarkers relatively early after the map is initialised, a error is thrown.
It seems even though the map is initialised, markerclusterer doesn't have a valid projection.
Environment details
Markerclusterer: 2.5.3
Steps to reproduce
create a markerclusterer object.
register mapInitialized Callback (in the callback call .clearMarkers or addMarkers)
This seems like an issue on render. It is guarding with map.getProjection() but then sending this.getProjection() to the algorithm. Meaning the parent overlay hasn't yet been given the projection.
Activity
odingrey commentedon Dec 15, 2025
This seems like an issue on render. It is guarding with
map.getProjection()but then sendingthis.getProjection()to the algorithm. Meaning the parent overlay hasn't yet been given the projection.rtcpw commentedon Dec 19, 2025
What kind of workaround can we use in the meantime?
odingrey commentedon Dec 19, 2025
I blocked my
render()onclusterer.getProjection().You just have to remember to set
noDrawto true when you add markers. Oh and if it fails you might not render, so make sure you try again.