leaflet
leaflet copied to clipboard
Leaflet map fails to resize when maximized.
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")); });