What happens
On a FairData Sites map, switching on an overlay from the layer menu draws it on top of the search results. On Global Writing Cultures, turning on the new Digital Atlas of the Roman Empire overlay hides most of the item markers under the atlas tiles. The same will happen with any raster or GeoJSON overlay a reader toggles after the results have loaded.
Why
OverlayLayer in the core-data package renders peripleo's RasterLayer (and GeoJSONLayer), and RasterLayer calls map.addLayer({ id, type: 'raster', source }) with no beforeId. MapLibre appends a layer with no insertion point to the top of the stack, so an overlay added after the result layers sits above them. Raster overlays are also drawn at a fixed raster-opacity of 1, and the opacity field on the overlay config is only honoured for georeferenced layers.
What it should do
Overlays should sit between the base map and the data layers, whenever they are switched on. Two ways to get there:
- Give
RasterLayer and GeoJSONLayer a beforeId prop, and have OverlayLayer insert overlays before the first data layer. The consumer (FairData Sites' Map component) knows the id of its first result layer and can pass it down.
- Or, after an overlay is added, move the data layers back to the top with
map.moveLayer.
Either way, honouring opacity for raster overlays (defaulting to something below 1) would help readers see markers through an atlas even when ordering is right.
Where
packages/core-data/src/components/OverlayLayer.js in this repo
packages/peripleo-maplibre/src/components/RasterLayer/RasterLayer.tsx in peripleo/peripleo
Seen on gwc.performant.studio at FairData Sites v1.11.0 with core-data 3.1.25 and @peripleo/maplibre 0.8.9. Related: performant-software/gwc-content#6.
What happens
On a FairData Sites map, switching on an overlay from the layer menu draws it on top of the search results. On Global Writing Cultures, turning on the new Digital Atlas of the Roman Empire overlay hides most of the item markers under the atlas tiles. The same will happen with any raster or GeoJSON overlay a reader toggles after the results have loaded.
Why
OverlayLayerin the core-data package renders peripleo'sRasterLayer(andGeoJSONLayer), andRasterLayercallsmap.addLayer({ id, type: 'raster', source })with nobeforeId. MapLibre appends a layer with no insertion point to the top of the stack, so an overlay added after the result layers sits above them. Raster overlays are also drawn at a fixedraster-opacityof 1, and theopacityfield on the overlay config is only honoured for georeferenced layers.What it should do
Overlays should sit between the base map and the data layers, whenever they are switched on. Two ways to get there:
RasterLayerandGeoJSONLayerabeforeIdprop, and haveOverlayLayerinsert overlays before the first data layer. The consumer (FairData Sites'Mapcomponent) knows the id of its first result layer and can pass it down.map.moveLayer.Either way, honouring
opacityfor raster overlays (defaulting to something below 1) would help readers see markers through an atlas even when ordering is right.Where
packages/core-data/src/components/OverlayLayer.jsin this repopackages/peripleo-maplibre/src/components/RasterLayer/RasterLayer.tsxin peripleo/peripleoSeen on gwc.performant.studio at FairData Sites v1.11.0 with core-data 3.1.25 and @peripleo/maplibre 0.8.9. Related: performant-software/gwc-content#6.