react-map-gl icon indicating copy to clipboard operation
react-map-gl copied to clipboard

[Bug] Terrain has a weird behavior on zoom.

Open abdallah-yassin-sager opened this issue 4 months ago • 5 comments

Description

When using the Mapbox terrain layer, zooming in closely causes markers to behave inconsistently — they flicker or jump back and forth instead of staying stable.

This is a screenshots:

Image Image Image Image

And this is the code: <Map key={mapBoxStyle} ref={mapRefCallback} mapboxAccessToken={mapBoxAccessToken} initialViewState={viewport} mapStyle={mapBoxStyle} onMouseMove={onMouseMove} onMove={evt => setViewport(evt.viewState)} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} projection='globe' onClick={onClick} onContextMenu={onContextMenu} interactiveLayerIds={['docks', 'drones']} terrain={{ source: 'mapbox-raster-dem', exaggeration: 1, }} // maxZoom={19} > <Source id='mapbox-raster-dem' type='raster-dem' url='mapbox://mapbox.mapbox-terrain-dem-v1' tileSize={512} maxzoom={20} /> </Map>

Expected Behavior

Markers should remain stable and fixed in place when zooming.

Steps to Reproduce

  1. Enable the terrain layer.
  2. Zoom in deeply on the map.
  3. Observe the marker positions.

Environment

  • Framework version: "react-map-gl": "^8.0.1",
  • Map library: Mapbox (mapbox-gl)- "^3.9.4",
  • Browser: Chrome and Firefox.
  • OS: Mac and Linux.

Logs

No response

abdallah-yassin-sager avatar Sep 08 '25 10:09 abdallah-yassin-sager

I’m experiencing the same issue

Mhamad6000 avatar Oct 02 '25 11:10 Mhamad6000

Might be related to this issue I opened too :o https://github.com/visgl/react-map-gl/issues/2549 But nothing seems to be moving here...

plgagnon2 avatar Oct 02 '25 12:10 plgagnon2

Try v8.1.0.

Pessimistress avatar Oct 03 '25 23:10 Pessimistress

Try v8.1.0.

I just tried v8.1.0, and the issue still exists.

Mhamad6000 avatar Oct 05 '25 06:10 Mhamad6000

@Mhamad6000 this is someone else's issue. If you believe yours is the same please create a CodeSandbox to reproduce.

Pessimistress avatar Oct 05 '25 16:10 Pessimistress