Skip to content

[Feature]: Add newly added layers to the top of the drawing order #808

Closed

Description

@deniial00

What problem does this solve?

Newly added layers can be hidden beneath existing layers instead of appearing on top. In the World Atlas startup project, the Countries layer obscures an added WMS: its imagery is visible only as a tint, with labels and roads unreadable. Under an opaque layer covering the same area, the added service layer is not visible at all.

The original question has a direction from @giswqs: Maintainer comment

This feature request tracks that behavior rather than a warning or a workaround specific to the sample project.

Proposed solution

Place newly added layers at the top of the drawing order, matching the GeoLibre behavior requested by @giswqs. Apply this consistently to feature, raster, and tile/service layers, rather than inserting them by geometry rank or into a tile-only stack below all map layers.

  • A newly added layer should draw above the existing data layers, including the World Atlas sample layers, without requiring the user to hide them first.
  • The Layers pane should show the same order the map actually draws. A tile/service layer must not appear to be on top while still rendering below feature or raster layers.
  • Keep the project basemap as the background; adding a data or service layer is distinct from choosing a basemap.
  • Review the Add Tile Layer Overlay wording alongside the change. The current description, “a transparent layer kept on top, such as labels or roads”, must agree with the resulting behavior rather than silently meaning only above other tile layers.

This changes insertion/drawing behavior in the existing add-layer workflows; it does not need a new ribbon destination.

Acceptance criteria

  • Adding the GEBCO WMS below to the World Atlas project places it above Cities, Rivers, Lakes and Countries in both the Layers pane and the rendered map. No sample layer needs to be disabled.
  • Adding a tile/service layer over an existing opaque raster draws the new layer above that raster.
  • Newly added feature layers, including WFS/OGC API layers, go above existing data layers regardless of point/line/polygon geometry. Newly added rasters, including WCS coverages, follow the same rule.
  • Adding another layer places that layer above the previously added layer without changing the relative order of the layers already present.
  • The basemap remains beneath the data layers, and the Overlay description matches its actual semantics.

Reproduction of the original problem

Reported on the desktop app built from source, v0.3.0 (42859ba), macOS 27 arm64:

  1. Open RustGIS with the World Atlas sample.

  2. Open Home › Add › Basemap › Add Tile Layer… and use:

    https://wms.gebco.net/mapserv?request=getmap&service=wms&version=1.3.0&layers=GEBCO_LATEST&crs=EPSG:3857&format=image/png&width=256&height=256&bbox={bbox-epsg-3857}
    
  3. Tick Overlay (a transparent layer kept on top, such as labels or roads) and select Add.

  4. The new row appears beneath Cities, Rivers, Lakes and Countries, above Basemap · Ocean. Countries still covers the service imagery.

  5. Hide the sample layers: the service imagery becomes fully visible.

Add Service Layer for WMS exhibits the same problem. The original report also notes that WFS/OGC API features are inserted by geometry rank and WCS rasters below feature layers.

Original screenshots, generated with the headless UI screenshot tool:

GEBCO WMS obscured by Countries

GEBCO WMS visible after hiding the sample layers

Implementation context from the original report

At the reported revision, the renderer composites tile layers before map layers (crates/render/src/lib.rs); overlay: true only orders a layer above other tile layers (crates/engine/src/cmd/service.rs and tiles.rs); and feature insertion uses geometry rank (crates/map/src/lib.rs). The report also notes that layer.move cannot address a tile layer, while the tile row menu only reorders within the tile stack. Moving a row alone will therefore not solve the rendering limitation.

These are starting points from the original investigation, not a prescribed implementation. Verify the changed behavior on the real rendered map as well as the Layers pane.

Estimated scope

Not sure.

Alternatives considered

  • Hide Countries or all sample layers: works around the startup example but not the general ordering problem.
  • Warn that the added layer draws beneath an existing layer: explains the problem without implementing the requested topmost insertion behavior.
  • Change only the Overlay text: removes ambiguity but still leaves newly added service layers hidden.

Activity

  1. added
    unconfirmed possible issue
    question
    and removed
    unconfirmed possible issue
    on Oct 24, 2026
  2. giswqs commented on Oct 24, 2026

    @giswqs
    Member

    We should probably must match GeoLibre behavior. Newly added layers are placed on top.

  3. added
    enhancement
    and removed
    question
    on Oct 26, 2026
  4. changed the title [-][Question]: A new project hides WMS layers under Countries[/-] [+][Feature]: Add newly added layers to the top of the drawing order[/+] on Oct 26, 2026
  5. pick2510 commented on Oct 27, 2026

    @pick2510
    Contributor

    I'm taking this one.

    Plan, general for every way a layer is added:

    • One drawing order for all layers. Web tile layers (WMS, WMTS, XYZ, vector tiles, PMTiles) can sit between feature and raster layers instead of always under them. A tile layer records the map layer it's drawn just over. Without one it stays under all map layers, which is where basemaps stay and where every existing project's tile layers stay, so saved projects draw as before.
    • New layers go on top, as in GeoLibre: feature layers whatever their geometry, rasters, analysis results, pasted layers, and tile layers added as overlays (WMS/WMTS/vector services, data overlays, "Overlay" in Add Tile Layer). Each new layer goes above the one added before it, and the layers already there keep their order. Basemaps (the gallery, Add Tile Layer without Overlay) stay under the data. A new layer still never splits a layer group.
    • Both renderers (the CPU one, also used for export and layouts, and the GPU map view) draw tile layers at their place in that order.
    • The Layers pane lists tile layers at their place in the drawing order. Move up/down (and dragging) moves them past map layers too.
    • Removing or moving a map layer leaves the tile layers over it where they are, by handing them to the layer below.

    Tests pin the old order of saved projects and check each way of adding a layer; I'll look at the rendered map too, not only the pane.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions