Skip to content

Commit

Permalink
fix(landing): force the vector source layer to be above the raster im…
Browse files Browse the repository at this point in the history
…ager (#2185)
  • Loading branch information
blacha authored May 11, 2022
1 parent 0a00e0e commit 31f7708
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/landing/src/components/debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
}
Expand Down

0 comments on commit 31f7708

Please sign in to comment.