Fix: attempt to fix #2312

This commit is contained in:
Pieter Vander Vennet 2025-02-16 02:40:26 +01:00
parent d1328dadb3
commit 225b07970d

View file

@ -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 = <GeoJSONSource>map.getSource(this._layername)
{
// Add source to the map or update the feature source