mapbox / mapbox/mapbox-gl-js

Markers in symbol layer disappear in a span of zoom even with icon-allow-overlap

Open
#13,474 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs information :pray:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 3.12.0 (and verified on 3.7.0 as well).

**browser**: Safari 18.5

### Steps to Trigger Behavior

1. We render markers using a GeoJSON-source defined as below, with symbol-layers defined as below:
Source:
```
name: 'properties',
def: {
type: 'geojson',
data: {type: 'FeatureCollection', features: []},
promoteId: 'id',
tolerance: 0.005
}
```

Marker layer:
```
{
id: 'properties-layer',
type: 'symbol',
source: 'properties',
'layout': {
'icon-image': ['case', ['to-boolean', ['get', 'aspect_color']], ['concat', ['get', 'aspect_color'], '_property_marker'], 'property_marker'], // reference the image
'icon-anchor': 'center',
'icon-offset': [0, 0],
'icon-allow-overlap': true,
'icon-ignore-placement': true,
'icon-size': 1.5
},
filter: ["!", ["has", "is_saved"]],
events: {
click: onItemClick
},
before_id: 'z-index-mid'
},
```

Line layer (that remains visible):
```
{
id: 'properties-layer-boundaries',
type: 'line',
source: 'properties',
paint: {
'line-color': ['match', ['get', 'aspect_color'], 'pink', '#E861B9', 'lime', '#94CC00', 'green', '#00A12E', 'orange', '#FF8F00', 'red', '#FE2B09', 'yellow', '#FFC403', 'purple', '#A616AC', 'turqoise', '#06B0A4', '#0064BF'],
'line-width': ['case', ['boolean', ['feature-state', 'selected'], false], 2, 1]
},
group_key: 'core'
},
```

No zoom-configuration is set on source or layer.

When zooming the map in/out - the markers disappear. There seems to a non-reliable correlation with the satellite-style (mapbox/satellite-v9) vs others, but this is not something I can reliably state.

See a video-screen recording below.

### Link to Demonstration

https://youtu.be/5TBOQjHjaWQ

### Expected Behavior

I would expect the markers, given the configuration of the symbol layer, to be constantly visible. Strangely enough, the layer with boundaries is rendered from the same source but stays consistently visible.

### Actual Behavior

When zooming the map in and out, in a span roughly equal to a scale-distance of 1.0 (as in - between ~13.6 and ~14.9) the markers just disappear, and then reappear once the map is zoomed either in or out beyond the span.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided GeoJSON source and symbol-layer configuration, zooming through roughly 13.6–14.9 while comparing the disappearing markers with the consistently visible line layer. Trace symbol-layer rendering and collision behavior around icon-allow-overlap and icon-ignore-placement; done means the markers remain visible throughout the zoom range.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.