Skip to content

Map overlays switched on at runtime paint over the search result markers #609

Description

@jamiefolsom

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:

  1. 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.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions