Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaflet markers move around on pan, depending on Zoom #143

Open
oranoran opened this issue Oct 11, 2021 · 8 comments
Open

Leaflet markers move around on pan, depending on Zoom #143

oranoran opened this issue Oct 11, 2021 · 8 comments

Comments

@oranoran
Copy link

oranoran commented Oct 11, 2021

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.

@khamui
Copy link

khamui commented Nov 2, 2021

Having the same issue with geoJSON layers (polygon layers as well). At the same time I am having the issue #145 . @oranoran did you find a solution/workaround for this?

I tried to add my geoJSON layer with addSource. But unfortunately i receive undefined for gl.getMapboxMap().

Any ideas to solve this issue?

@oranoran
Copy link
Author

oranoran commented Nov 2, 2021

Having the same issue with geoJSON layers (polygon layers as well). At the same time I am having the issue #145 . @oranoran did you find a solution/workaround for this?

Nope, for now I reverted back from GL to using a TileLayer.

But long-term, if this isn't resolved somehow, I will need to either drop Leaflet and stay with MapBase vanilla, or drop MapBase and use some other backend.

@yemling
Copy link

yemling commented Mar 17, 2022

I'm also having this issue and it's a real shame as I have several highly interactive Leaflet maps that have markers, wms, etc that get stuck when panning with GL. Is there a work around? @oranoran you said you reverted to using a tileLayer, is that still a mapbox vector layer?

@AntoineJaury
Copy link

I've the same problem on a map. Downgrading mapbox-leaflet-gl to v0.0.7 works. From v0.0.8 the problem with the markers/map not moving synchronously appears.

On v0.0.8 a padding option has been added (v0.0.7...v0.0.8#diff-c10a1c84c325e16badffd67a4a9a005cee3b6228787969d42e293ff61c299059R18). Could it be the source of the problem?

@AntoineJaury
Copy link

In fact, I also reproduce it with the v0.0.7. The cases are less often but the bug is still here.

@vedelsbrunner
Copy link

same problem here

@pratik-kanthi
Copy link

Downgrading mapbox-gl to 1.13.1 solved it for me

@jessegpierce
Copy link

jessegpierce commented Mar 7, 2023

Same bug in 3/7/23 but the above downgrade works for me.
I actually went to 2.0.0 and it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants