From 4642648a697d79110b43dfe428ee6e72921fe5c1 Mon Sep 17 00:00:00 2001 From: ccmdi Date: Fri, 21 Nov 2025 13:59:56 -0500 Subject: [PATCH] feat: rerender on relevant config change --- src/views/map-bases-view.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/views/map-bases-view.ts b/src/views/map-bases-view.ts index 75f5525..904650e 100644 --- a/src/views/map-bases-view.ts +++ b/src/views/map-bases-view.ts @@ -113,6 +113,9 @@ export class MapBasesView extends BasesView { } protected loadConfig(): void { + const oldCoordinatesProp = this.coordinatesProp; + const oldPolygonProp = this.polygonProp; + this.coordinatesProp = this.config.getAsPropertyId('coordinates'); this.coverProp = this.config.getAsPropertyId('coverImage'); this.polygonProp = this.config.getAsPropertyId('polygonPoints'); @@ -139,6 +142,7 @@ export class MapBasesView extends BasesView { this.center = [0, 0]; // Reset if not configured } + const oldMarkerType = this.markerType; const markerTypeVal = this.config.get('markerType'); if (markerTypeVal === 'pins' || markerTypeVal === 'dots') { this.markerType = markerTypeVal; @@ -156,6 +160,11 @@ export class MapBasesView extends BasesView { if (oldTileLayer !== this.tileLayer && this.deck) { this.destroyMap(); } + + // If coordinates, polygon property, or marker type changed, force update + if ((oldCoordinatesProp !== this.coordinatesProp || oldPolygonProp !== this.polygonProp || oldMarkerType !== this.markerType) && this.deck) { + this.lastPoints = []; // Clear cache to force update + } } protected renderMap(): void {