Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Min / Max Zoom Level Clamping In Core and Android #3812

Merged
merged 3 commits into from
Feb 4, 2016
Merged

Min / Max Zoom Level Clamping In Core and Android #3812

merged 3 commits into from
Feb 4, 2016

Conversation

bleege
Copy link
Contributor

@bleege bleege commented Feb 4, 2016

Closes #509

…in Android. Clamping Min and Max zooms at Core GL for all platforms to use at runtime.
@bleege bleege added iOS Mapbox Maps SDK for iOS Android Mapbox Maps SDK for Android labels Feb 4, 2016
@bleege bleege added this to the android-v4.0.0 milestone Feb 4, 2016
@bleege
Copy link
Contributor Author

bleege commented Feb 4, 2016

Can you 👀 this PR @ansis @1ec5 to make sure it's inline with what we discussed in Slack earlier today? If it's good then feel free to merge!

zoom = 25.5;
}
if (minZoom < 0) {
zoom = 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be succinctly expressed as util::clamp(minZoom, 0.0, 25.5). But you should also ensure that the minimum zoom level is less than the maximum.

@1ec5
Copy link
Contributor

1ec5 commented Feb 4, 2016

The numbers 0.0 and 25.5 should be factored out into constants. They can go right alongside PITCH_MAX in constants.h/.cpp.

@bleege
Copy link
Contributor Author

bleege commented Feb 4, 2016

Thanks for the suggestions @1ec5! I've now implemented and tested them locally in Android. Assuming Travis / Bitrise is happy with it I'll push it into master.

@bleege
Copy link
Contributor Author

bleege commented Feb 4, 2016

Bitrise and Travis approved. Time to merge!

@bleege bleege merged commit 87bac32 into master Feb 4, 2016
@bleege bleege self-assigned this Feb 4, 2016
@bleege bleege deleted the 509-max25 branch February 4, 2016 01:18
@bleege bleege mentioned this pull request Feb 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants