From 566cebac9203384b328912212661c73f1584477b Mon Sep 17 00:00:00 2001 From: antoine37120 Date: Thu, 25 Apr 2024 16:30:42 +0200 Subject: [PATCH] fix init with empty widgetValues on mapWidget --- src/sparnatural/components/widgets/MapWidget.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sparnatural/components/widgets/MapWidget.ts b/src/sparnatural/components/widgets/MapWidget.ts index 76e4bd86..5c61de42 100644 --- a/src/sparnatural/components/widgets/MapWidget.ts +++ b/src/sparnatural/components/widgets/MapWidget.ts @@ -143,7 +143,7 @@ export default class MapWidget extends AbstractWidget { #redrawSelection = () => { - if(this.widgetValues !== undefined) { + if ((this.widgetValues !== undefined) && (this.widgetValues.length > 0)) { let options = { color: "#3388ff", weight: 3, @@ -207,7 +207,7 @@ export default class MapWidget extends AbstractWidget { this.#redrawSelection() ; - if(this.widgetValues !== undefined) { + if ((this.widgetValues !== undefined) && (this.widgetValues.length > 0)) { var layers = []; //layers = L.PM.Utils.findLayers(this.map)