Keep map updates independent of tile loading
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-19 02:45:53 +02:00
parent e5c56272d7
commit 46aa644b24
2 changed files with 12 additions and 11 deletions
@@ -48,6 +48,7 @@ def test_map_rectangle_drag_is_wired_to_automatic_analysis() -> None:
assert "resizeObserver.observe(containerRef.current)" in geomap assert "resizeObserver.observe(containerRef.current)" in geomap
assert "fitDataOnChangeRef.current" in geomap assert "fitDataOnChangeRef.current" in geomap
assert geomap.count("map.fitBounds(bounds, { padding: 40, duration: 0 })") == 3 assert geomap.count("map.fitBounds(bounds, { padding: 40, duration: 0 })") == 3
assert "isStyleLoaded()" not in geomap
assert "const activeCollection = areaData ?? (fitDataOnChange ? data : null)" in geomap assert "const activeCollection = areaData ?? (fitDataOnChange ? data : null)" in geomap
assert "data && fitDataOnChange && !areaData" in geomap assert "data && fitDataOnChange && !areaData" in geomap
assert "resizeObserver.disconnect()" in geomap assert "resizeObserver.disconnect()" in geomap
+11 -11
View File
@@ -230,7 +230,7 @@ function GeoMap({
const fitCollection = areaDataRef.current const fitCollection = areaDataRef.current
?? (fitDataOnChangeRef.current ? dataRef.current : null) ?? (fitDataOnChangeRef.current ? dataRef.current : null)
const bounds = fitCollection ? collectCoordinates(fitCollection) : null const bounds = fitCollection ? collectCoordinates(fitCollection) : null
if (bounds && map.isStyleLoaded()) { if (bounds) {
map.fitBounds(bounds, { padding: 40, duration: 0 }) map.fitBounds(bounds, { padding: 40, duration: 0 })
} }
}) })
@@ -344,7 +344,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
for (const overlayId of [...imageOverlayIdsRef.current].reverse()) { for (const overlayId of [...imageOverlayIdsRef.current].reverse()) {
@@ -382,7 +382,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
@@ -434,7 +434,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
if (map.getLayer('dataset-fill')) { if (map.getLayer('dataset-fill')) {
@@ -447,7 +447,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
@@ -504,7 +504,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
const visibility = visible ? 'visible' : 'none' const visibility = visible ? 'visible' : 'none'
@@ -520,7 +520,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
const visibility = areaVisible ? 'visible' : 'none' const visibility = areaVisible ? 'visible' : 'none'
@@ -536,7 +536,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
@@ -586,7 +586,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
@@ -619,7 +619,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }
@@ -666,7 +666,7 @@ function GeoMap({
useEffect(() => { useEffect(() => {
const map = mapRef.current const map = mapRef.current
if (!map || !mapStyleReady || !map.isStyleLoaded()) { if (!map || !mapStyleReady) {
return return
} }