From f203a1158d50870398b9651524d3adf1e8aa7219 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 16 Apr 2023 04:26:50 +0200 Subject: [PATCH] Refactoring: fix usersettings vis --- Models/ThemeConfig/Conversion/PrepareLayer.ts | 2 +- UI/Popup/MinimapViz.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Models/ThemeConfig/Conversion/PrepareLayer.ts b/Models/ThemeConfig/Conversion/PrepareLayer.ts index 370464d19..ad1ddae4d 100644 --- a/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -1144,7 +1144,7 @@ export class AddMiniMap extends DesugaringStep { } convert(layerConfig: LayerConfigJson, context: string): { result: LayerConfigJson } { - if (!layerConfig.tagRenderings) { + if (!layerConfig.tagRenderings || layerConfig.source === "special") { return { result: layerConfig } } const state = this._state diff --git a/UI/Popup/MinimapViz.ts b/UI/Popup/MinimapViz.ts index c6ca940b0..7c6d67fda 100644 --- a/UI/Popup/MinimapViz.ts +++ b/UI/Popup/MinimapViz.ts @@ -34,7 +34,7 @@ export class MinimapViz implements SpecialVisualization { feature: Feature, layer: LayerConfig ) { - if (state === undefined) { + if (state === undefined || feature === undefined || layer.source === undefined) { return undefined } const keys = [...args] @@ -83,6 +83,9 @@ export class MinimapViz implements SpecialVisualization { } } featuresToShow.addCallbackAndRunD((features) => { + if (features.length === 0) { + return + } const bboxGeojson = GeoOperations.bbox({ features, type: "FeatureCollection" }) const [lon, lat] = GeoOperations.centerpointCoordinates(bboxGeojson) mla.bounds.setData(BBox.get(bboxGeojson))