From 225b07970d7a335085fa28316863a63584be595b Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 16 Feb 2025 02:40:26 +0100 Subject: [PATCH] Fix: attempt to fix #2312 --- src/UI/Map/ShowDataLayer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/UI/Map/ShowDataLayer.ts b/src/UI/Map/ShowDataLayer.ts index 15aa40d70f..710891da7a 100644 --- a/src/UI/Map/ShowDataLayer.ts +++ b/src/UI/Map/ShowDataLayer.ts @@ -352,6 +352,11 @@ class LineRenderingLayer { // After waiting 'till the map has loaded, the data might have changed already // As such, we only now read the features from the featureSource and compare with the previously set data const features = featureSource.data + if (features.length === 0) { + // This is a very ugly workaround for https://source.mapcomplete.org/MapComplete/MapComplete/issues/2312, + // but I couldn't find the root cause + return + } const src = map.getSource(this._layername) { // Add source to the map or update the feature source