-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Add parameter to fit to integer zoom levels #1367
Conversation
69e0c6f
to
2bef46e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if everybody is okay with this feature it can be merged (cc @JaffaKetchup)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any code to show the effectiveness of this at all ?
@ibrierley I require this in a project I'm working on, which is also the place where I've tested it. What kind of example do you have in mind? The degree of effectiveness is similar to the |
I'm just thinking of a way to test it is all, so maybe future code changes can use to check its still working (don't really mean a full example page, but just something people can use to highlight its working or not. |
@ibrierley I've added a test that checks the fit bounds methods for some parameters. The change of the expected zoom values and the consistent center point give an impression of what is going on. At least this test can fail in the future if any internal implementation details change. |
@ibrierley This good for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see any obvious problems if others are happy with it!
Sure, you merge it if you're happy. |
Since flutter map is mostly used with pixel tiles, it is often desirable to use integer zoom levels in order to avoid any pixel tile upscaling. Currently this isn't possible using the
fitBounds
andcenterZoomFitBounds
methods.This PR adds an additional parameter to the
FitBoundsOptions
calledforceIntegerZoomLevel
in order to force the calculation of applicable integer zoom levels of the aforementioned functions.