Stabilize programmatic map fitting
This commit is contained in:
@@ -426,7 +426,7 @@ function GeoMap({
|
||||
if (collection.type === 'FeatureCollection' && collection.features.length > 0) {
|
||||
const bounds = collectCoordinates(collection)
|
||||
if (bounds) {
|
||||
map.fitBounds(bounds, { padding: 40 })
|
||||
map.fitBounds(bounds, { padding: 40, duration: 0 })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,7 +497,7 @@ function GeoMap({
|
||||
if (activeCollection) {
|
||||
const bounds = collectCoordinates(activeCollection)
|
||||
if (bounds) {
|
||||
map.fitBounds(bounds, { padding: 40 })
|
||||
map.fitBounds(bounds, { padding: 40, duration: 0 })
|
||||
}
|
||||
}
|
||||
}, [areaData, data, fitDataOnChange, mapStyleReady])
|
||||
|
||||
Reference in New Issue
Block a user