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

Fix output of Map#project during drag pan inertia #2901

Closed
yunluyl opened this issue Jul 22, 2016 · 5 comments
Closed

Fix output of Map#project during drag pan inertia #2901

yunluyl opened this issue Jul 22, 2016 · 5 comments

Comments

@yunluyl
Copy link
Contributor

yunluyl commented Jul 22, 2016

The pixel position returned from the map.project(lnglat) function drift from the real lnglat position on the map during drag pan inertia animation (the slow down effect after drag stops with speed).

@mourner
Copy link
Member

mourner commented Jul 29, 2016

Can you set up a JSFiddle test case to demonstrate the issue?

@yunluyl
Copy link
Contributor Author

yunluyl commented Jul 29, 2016

I set up a jsfiddle, and found out the problem is actually caused by the map.project(lnglat) function. I was using map.getCenter and map.project at the same time in my project. Somehow it made me thought the problem was caused by getCetner. I was wrong. I'll update the issue title and description.

The problem is when I use map.project to project a div to a lnglat position on the map, it drifts form the real position during drag pan inertia animation.

JSFiddle is here:
https://jsfiddle.net/3wxrt7nu/2/

@yunluyl yunluyl changed the title map.getCenter() doesn't match with the drag pan inertia map.project(lnglat) doesn't project to correct position during drag pan inertia Jul 29, 2016
@mourner
Copy link
Member

mourner commented Jul 29, 2016

Yeah, it looks like the same problem that causes mapboxgl.Marker elements to drift on inertia... Also reproducible when panning using keyboard.

@lucaswoj lucaswoj changed the title map.project(lnglat) doesn't project to correct position during drag pan inertia Fix output of Map#project during drag pan inertia Jul 29, 2016
@songyumeng
Copy link

Hi,how about this problem?Is there any way to fix?

@jfirebaugh
Copy link
Contributor

This was fixed by either #6005 or #4670.

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

No branches or pull requests

5 participants