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:
parent
9aeffda8d1
commit
f8784bbcec
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user