From 2ae37e126a2a194c18c3d9c3ad8930926cc9965a Mon Sep 17 00:00:00 2001 From: Dirk van Meeuwen Date: Thu, 8 Feb 2024 11:40:30 +0100 Subject: [PATCH 1/3] Set empty default value for empty reduce --- src/lib/topology/locations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/topology/locations.ts b/src/lib/topology/locations.ts index d769af09e..3954fb902 100644 --- a/src/lib/topology/locations.ts +++ b/src/lib/topology/locations.ts @@ -27,9 +27,9 @@ export async function fetchLocationsAsGeoJson( ) // Merge them into a single GeoJSON. const geojson = allGeoJson.reduce((prev, cur) => { - prev.features.concat(cur.features) + prev.features = prev.features.concat(cur.features) return prev - }) + }, { type: 'FeatureCollection', features: [] }) return geojson } From d672b6d7b8e5ad08cb3e2f68f26c9efc5fc4a355 Mon Sep 17 00:00:00 2001 From: Dirk van Meeuwen Date: Thu, 8 Feb 2024 11:45:58 +0100 Subject: [PATCH 2/3] Only show locations layer when locatsions are present --- src/components/wms/LocationsLayerComponent.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/wms/LocationsLayerComponent.vue b/src/components/wms/LocationsLayerComponent.vue index 9f65ef046..1fb682154 100644 --- a/src/components/wms/LocationsLayerComponent.vue +++ b/src/components/wms/LocationsLayerComponent.vue @@ -1,11 +1,12 @@