fix: keep map canvas synchronized with workspace
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-14 15:51:10 +02:00
parent 986640d5b3
commit 3503641ea8
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -175,6 +175,10 @@ function GeoMap({
zoom: 11,
attributionControl: false,
})
const resizeObserver = new ResizeObserver(() => {
map.resize()
})
resizeObserver.observe(containerRef.current)
map.addControl(new maplibregl.NavigationControl(), 'top-right')
map.addControl(
new maplibregl.AttributionControl({
@@ -196,6 +200,7 @@ function GeoMap({
})
}
map.on('load', () => {
map.resize()
setMapStyleReady(true)
emitViewport()
})
@@ -274,6 +279,7 @@ function GeoMap({
mapRef.current = map
return () => {
resizeObserver.disconnect()
map.remove()
mapRef.current = null
setMapStyleReady(false)