mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-01 08:12:32 +00:00
overlays below traces
This commit is contained in:
@@ -100,6 +100,17 @@
|
||||
|
||||
newMap.on('style.load', toggleTerrain);
|
||||
newMap.on('pitch', toggleTerrain);
|
||||
|
||||
newMap.on('style.load', () => {
|
||||
// add dummy layer to place the overlay layers below
|
||||
newMap.addLayer({
|
||||
id: 'overlays',
|
||||
type: 'background',
|
||||
paint: {
|
||||
'background-color': 'rgba(0, 0, 0, 0)'
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$: if ($map) {
|
||||
|
@@ -69,7 +69,8 @@
|
||||
if (!$map.getSource(id)) {
|
||||
$map.addSource(id, overlays[id]);
|
||||
}
|
||||
$map.addLayer({
|
||||
$map.addLayer(
|
||||
{
|
||||
id,
|
||||
type: overlays[id].type === 'raster' ? 'raster' : 'line',
|
||||
source: id,
|
||||
@@ -80,7 +81,9 @@
|
||||
: { 'line-opacity': opacities[id] }
|
||||
: {})
|
||||
}
|
||||
});
|
||||
},
|
||||
'overlays'
|
||||
);
|
||||
} catch (e) {
|
||||
// No reliable way to check if the map is ready to add sources and layers
|
||||
}
|
||||
|
Reference in New Issue
Block a user