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
I am using map.invalidateSize() to tell my map container that a panel in my layout was removed and to use the full size again.
However, calling invalidateSize during the first render of the page breaks leaflet-hash in the sense, that the provided hash location (provided by a deep link / external link with hash), does not position the map on the hash's position but the default position instead.
I am using
map.invalidateSize()
to tell my map container that a panel in my layout was removed and to use the full size again.However, calling
invalidateSize
during the first render of the page breaks leaflet-hash in the sense, that the provided hash location (provided by a deep link / external link with hash), does not position the map on the hash's position but the default position instead.To me, it looks like the resize code from
invalidateSize
prevents leaflet-hash from receiving the hash location.(Somewhere here https://github.com/Leaflet/Leaflet/blob/0f904a515879fcd08f69b7f51799ee7f18f23fd8/src/map/Map.js#L596-L599)
Workaround
As a workaround, I now set the default map position to the hash's position before initializing the map:
osmberlin/strassenraumkarte-neukoelln@1324d35#diff-0eb547304658805aad788d320f10bf1f292797b5e6d745a3bf617584da017051R11-R19
Live example: https://supaplexosm.github.io/strassenraumkarte-neukoelln/?map=parkingmap#18/52.47773/13.43523
The text was updated successfully, but these errors were encountered: