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
panTo() does not center map at requested coordinate #922
Comments
Duplicate of #426. |
Sorry, for commenting here, but this seems like a very accurate description of what I'm seeing. I've made this jsbin: https://jsbin.com/putezoyido/edit?js,console,output When you click "Go to new location" we call map.panTo([41.142937, -8.534538]); however,
Is this something expected or a bug? |
So what's the solution? :S I'm trying to pan but it pans me nowhere near the coordinates I'm giving it.. Been trying to find a solution for the last hour but none of them works. Why can't the panTo just work like it's supposed to? |
Hi @chrillewoodz, great to hear that you find Leaflet useful! Instead of commenting an old and closed ticket, and if you are really sure that this is a bug in Leaflet, please open a new issue. Please provide an effective bug report, and in particular all the information requested in the issue template (provided when you create a new issue), so that we can effectively investigate. |
Let's try to center and zoom a map on the greenwich observatory ...
map.setZoom(0); map.panTo(0,0);
(start at a known coord/zoom level)map.panTo([51.4768, 0.0006])
to center map at greenwich observatory (in theory)map.setZoom(16)
to zoom inThis is confirmed by
map.getCenter().toString()
=>LatLng(51.61802, 0)
The text was updated successfully, but these errors were encountered: