Fix: make sure the background is always below the rendered layers

This commit is contained in:
Pieter Vander Vennet 2023-10-08 19:02:41 +02:00
parent 93630bd1db
commit 2769747737
2 changed files with 2 additions and 1 deletions

View file

@ -422,6 +422,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
map.addSource(background.id, MapLibreAdaptor.prepareWmsSource(background)) map.addSource(background.id, MapLibreAdaptor.prepareWmsSource(background))
} }
if (!map.getLayer(background.id)) { if (!map.getLayer(background.id)) {
addLayerBeforeId ??= map.getStyle().layers.find(l => l.id.startsWith("mapcomplete_"))?.id
console.log( console.log(
"Adding background layer", "Adding background layer",
background.id, background.id,

View file

@ -515,7 +515,7 @@ export default class ShowDataLayer {
const l = new LineRenderingLayer( const l = new LineRenderingLayer(
map, map,
features, features,
this._options.layer.id + "_linerendering_" + i, "mapcomplete_"+this._options.layer.id + "_linerendering_" + i,
lineRenderingConfig, lineRenderingConfig,
doShowLayer, doShowLayer,
fetchStore, fetchStore,