Fix: attempts to stabilize

This commit is contained in:
Pieter Vander Vennet 2025-03-11 03:53:05 +01:00
parent 686ad70511
commit ae84207555
4 changed files with 31 additions and 24 deletions

View file

@ -590,7 +590,11 @@ export default class ShowDataLayer {
}
const bbox = BBox.bboxAroundAll(features.map(BBox.get))
window.requestAnimationFrame(() => {
map.resize()
try {
map.resize()
} catch (e) {
console.error("Could not resize the map in preparation of zoomToCurrentFeatures; the error is:", e)
}
map.fitBounds(bbox.toLngLat(), {
padding: { top: 10, bottom: 10, left: 10, right: 10 },
animate: false,