From 31f7708f8cc5d6180d879248c6677d0b6cf3307a Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Wed, 11 May 2022 14:43:03 +1200 Subject: [PATCH] fix(landing): force the vector source layer to be above the raster imager (#2185) --- packages/landing/src/components/debug.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/landing/src/components/debug.tsx b/packages/landing/src/components/debug.tsx index 149c2e966..5af12d366 100644 --- a/packages/landing/src/components/debug.tsx +++ b/packages/landing/src/components/debug.tsx @@ -323,7 +323,6 @@ export class Debug extends Component< }; adjustRaster(rasterId: 'osm' | 'linz-aerial', range: number): void { - // Config.map.setDebug(`debug-layer-${rasterId}`, range); if (this.props.map.getSource(rasterId) == null) { this.props.map.addSource(rasterId, { type: 'raster', @@ -347,6 +346,13 @@ export class Debug extends Component< maxzoom: 24, paint: { 'raster-opacity': 0 }, }); + + // Ensure this raster layers are below the vector layer + const sourceLayerId = `${Config.map.layerId}_source_fill`; + const isSourceLayerEnabled = this.props.map.getLayer(sourceLayerId) != null; + if (isSourceLayerEnabled) { + this.props.map.moveLayer(rasterId, sourceLayerId); + } } this.props.map.setPaintProperty(rasterId, 'raster-opacity', range); }