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

Slide map along map boundaries #430

Merged
merged 18 commits into from
Jul 8, 2020
Merged

Conversation

Lootwig
Copy link
Contributor

@Lootwig Lootwig commented Sep 23, 2019

This gives users the option to replace the behavior where, on reaching the boundaries while panning, the movement is simply canceled. Instead, if there is a free movement axis, the pan movement vector's component along that axis is still used.

Boundaries calculations are additionally extended to account for the actual screen boundary rather than just checking whether the center is inside/outside, in order to simplify working with downloaded tiles. This ensures that, as long as the currently visible map slice is smaller than the boundaries, there will never be a need for tiles outside those boundaries.

Caching a few tiles outside the boundaries is recommended for cases where the user is allowed to zoom out so much that the entire area fits on the screen.

@johnpryan
Copy link
Collaborator

Thanks for the PR - would you mind making this an additional option on MapOptions instead of making a new subclass? I would also like to see an example and maybe some tests.

@Lootwig
Copy link
Contributor Author

Lootwig commented Dec 17, 2019

@johnpryan I did add an example for the boundary sliding feature,

However I am not sure if another one for the adaptive boundary calculation makes sense. I built the feature in order to allow tile downloading for offline maps using only tiles actually covering area inside the specified boundaries (without the need for buffer tiles that are attempted to load when zooming out). This is hard to demonstrate inside an example in my opinion, do you disagree?

@johnpryan
Copy link
Collaborator

johnpryan commented Dec 17, 2019

Yeah it's potentially confusing for users, so I think it's helpful to have an example if possible.

@Lootwig
Copy link
Contributor Author

Lootwig commented Dec 17, 2019

The example would differ from the "offline map" one exclusively by the amount of tiles in the assets folder 🤔 I don't see how this would be more useful than elaborating in the parameter documentation?

@johnpryan
Copy link
Collaborator

I see your point about the sample, thanks for adding it anyway 😆

@johnpryan johnpryan merged commit 9e526e5 into fleaflet:master Jul 8, 2020
@rorystephenson rorystephenson mentioned this pull request Jun 11, 2023
5 tasks
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.

2 participants