I'm trying to create a Leaflet map which is hidden when the page loads, and revealed when the user clicks a button.
This works to show/hide the map's div - but the formatting of the map is broken, with a large empty area with no data:
This only occurs when the map's div has the
.collapse class - if you remove that class the map loads correctly.
So the question is, how to allow a Leaflet map to load correctly when it isn't visible when the page loads?