Skip to content

symbol layers using symbol-placement: line render above line layers at zoom < 13.7 in Mapbox Standard #13711

Description

@MobileD2

mapbox-gl-js version

3.28.0

Browser and version

Chrome 151.0.7922.75

Expected behavior

A line layer added after a symbol layer (intended to render on top) should remain visually above the symbols at all zoom levels.

Actual behavior

When zooming out past ~13.7 in Mapbox Standard, symbol layers placed along lines are hoisted into a top-level overlay pass, rendering directly on top of line layers regardless of beforeId, slot, or execution order.

Link to the demonstration

No response

Steps to trigger the unexpected behavior

  1. Load Mapbox GL JS (latest v3 release) with mapbox://styles/mapbox/standard.
  2. Add a symbol layer (planned-dots) with symbol-placement: "line" along a LineString.
  3. Add a line layer (route-line) on top of planned-dots (e.g. map.addLayer(routeLine) called after planned-dots).
  4. Observe correct z-ordering at zoom > 14 (route-line covers planned-dots).
  5. Zoom out past 13.7 and observe planned-dots hopping on top of route-line.
// 1. Add Planned Dots (Symbol Layer - rendered first/below)
map.addLayer({
    id: 'planned-dots',
    type: 'symbol',
    source: 'route-source',
    layout: {
        'symbol-placement': 'line',
        'symbol-spacing': 20,
        'icon-image': 'dot-icon',
        'icon-allow-overlap': true,
        'icon-ignore-placement': true
    }
});

// 2. Add Route Line (Line Layer - added second to render ON TOP of dots)
map.addLayer({
    id: 'route-line',
    type: 'line',
    source: 'route-source',
    paint: {
        'line-color': '#2a82e4',
        'line-width': 8
    }
}); // Drawn after planned-dots to sit on top

### Relevant log output

```shell

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions