leaflet icon indicating copy to clipboard operation
leaflet copied to clipboard

Leaflet map fails to resize when maximized.

Open j-craggy opened this issue 3 years ago • 0 comments

Similar to this issue, but occurs when using shinydashboard with multiple menu items. When swapping between menu items if the window is resized, then maximized, when switching back to the map menuitem, does not fully render.

A reprex can be found here .

I was able to find the solution by using a similar approach which was implemented in the leaflet sidebar menu issue.

We can target a specific list item or all of them.

$(document).on('click', '.sidebar-menu li', function() { window.dispatchEvent(new Event("resize")); });

j-craggy avatar Sep 08 '22 14:09 j-craggy