fix: Leaflet map tile rendering in collapsed containers

invalidateSize() + refitBounds after 200ms delay fixes tiles only loading
in top-left corner when map card was initially hidden
This commit is contained in:
Rene Fichtmueller 2026-03-27 23:19:57 +13:00
parent 9aeffda8d1
commit f8784bbcec

View File

@ -1317,6 +1317,13 @@ function renderNetworkMap(d) {
});
_pcMap.fitBounds(bounds, { padding: [30, 30], maxZoom: 6 });
// Fix tile rendering in initially-hidden containers
setTimeout(function() {
if (_pcMap) {
_pcMap.invalidateSize();
_pcMap.fitBounds(bounds, { padding: [30, 30], maxZoom: 6 });
}
}, 200);
}