mapgl icon indicating copy to clipboard operation
mapgl copied to clipboard

bounds initializes incorrectly in hidden tabs

Open CIOData opened this issue 2 months ago • 0 comments

I am having an issue with maps fitting to their bounds correctly when they are in a tab. My understanding is that this is because they are rendering to a container of size 0x0 when hidden and not updating when the container gets resized. I know I could "fix" this downstream by having the map resize to bounds after some other user action, but that's not desirable. The leaflet package has some sort of workaround that invalidates the initial size when the container is activated. I would love if this functionality could be added to mapgl as well. Thanks.

Fit on active tab at start:

Image

Fit on tab hidden at start when activated:

Image

CIOData avatar Oct 11 '25 14:10 CIOData