diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index d41bcc25dd..eb70c3e4d5 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 671b6478de..e49b44c782 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,