Leaflet/Leaflet.fullscreen

Invalidate map size on fullscreen toggle

zuck opened this issue · 1 comments

zuck commented

On my map I'm using a GeoJSON layer and custom CSS margin to locate it on the page.

When I switch to fullscreen mode, the GeoJSON layer doesn't display shapes correctly, still taking in consideration the old CSS margin (but actually removed by CSS when the map is fullscreen).

The only fix I found is to fire a map.invalidateSize() when the fullscreenchange event is emitted.

Thanks for the report @zuck. Want to submit a PR that adds invalidateSize() to _setFullscreen?