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

Refine zooming and panning for note and data layers #646

Closed
wants to merge 3 commits into from
Closed

Refine zooming and panning for note and data layers #646

wants to merge 3 commits into from

Conversation

aaronlidman
Copy link
Member

Resolves #629 #643, improves #644.

Only centers and/or zooms when clicking a note or data on a new page load (such as directly visiting /note/xx) or if the data doesn't completely fit inside the map view. Otherwise the map view doesn't move and the item is simply highlighted.

};

page.load = function () {
function initialize(loadType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loadType is unused.

@tomhughes
Copy link
Member

I'm seeing some weird behaviour with this where leaflet seems to "crash" and doesn't finish loading tiles properly or allow me to pan or zoom.

As best I can tell one trigger is loading a note from the URL bar when my current zoom is not 16 so that it tries to do a zoom after loading but gets stuck with a broken map.

@aaronlidman
Copy link
Member Author

I was only able to reproduce the problem when directly visiting a notes page, did you see it anywhere else? It's a weird issue because as you said zoom 16 worked, but none of the others did. Also just changing setView to panTo works fine. Seems like it was some kind of timing issue, I'm not sure where, but making it a callback to initialize works fine.

@tomhughes
Copy link
Member

Merged as a796c41.

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

Successfully merging this pull request may close these issues.

When the data layer is turned on and an item is clicked on, the map recentres, losing the context.
3 participants