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 {