mapbox / mapbox/mapbox-gl-leaflet

Leaflet markers move around on pan, depending on Zoom

Open
#143 9 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
546
Forks
148
PR merge metrics
No merged PRs in 30d

Description

When creating a mapgox-gl-leaflet map and adding Leaflet markers to it, these markers are not stable.
Markers move around (all at once) as the map is panned, so they are no longer where they are supposed to be.

To reproduce, simply check out this code pen.
It's a simple copy-paste of the Basic example from this project, with versions updated to mapbox-gl v2.5.1 and leaflet 1.7.1, and an added 2nd Leaflet marker.

You can see that markers move around as the map is panned (also recorded in this video).

In other experiments I made (but unfortunately I didn't capture these), this would happen only at some zoom levels. So if I start at zoom level 5 everything is cool, then I zoom out and it breaks, I zoom out some more and it's ok, I zoom out some more and it breaks again.

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 running the linked CodePen reproduction based on the project's Basic example with Mapbox GL v2.5.1 and Leaflet 1.7.1. Inspect marker positioning while panning and across the reported zoom levels; the issue is done when all Leaflet markers remain at their intended locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.