From 2769747737964a509897ccce4702a9ea9ebefcd8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 8 Oct 2023 19:02:41 +0200 Subject: [PATCH] Fix: make sure the background is always below the rendered layers --- src/UI/Map/MapLibreAdaptor.ts | 1 + src/UI/Map/ShowDataLayer.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index d41bcc25d..eb70c3e4d 100644 --- a/src/UI/Map/MapLibreAdaptor.ts +++ b/src/UI/Map/MapLibreAdaptor.ts @@ -422,6 +422,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { map.addSource(background.id, MapLibreAdaptor.prepareWmsSource(background)) } if (!map.getLayer(background.id)) { + addLayerBeforeId ??= map.getStyle().layers.find(l => l.id.startsWith("mapcomplete_"))?.id console.log( "Adding background layer", background.id, diff --git a/src/UI/Map/ShowDataLayer.ts b/src/UI/Map/ShowDataLayer.ts index 671b6478d..e49b44c78 100644 --- a/src/UI/Map/ShowDataLayer.ts +++ b/src/UI/Map/ShowDataLayer.ts @@ -515,7 +515,7 @@ export default class ShowDataLayer { const l = new LineRenderingLayer( map, features, - this._options.layer.id + "_linerendering_" + i, + "mapcomplete_"+this._options.layer.id + "_linerendering_" + i, lineRenderingConfig, doShowLayer, fetchStore,