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

Various zoom level corrections #3401

Merged
merged 4 commits into from
Dec 25, 2015
Merged

Various zoom level corrections #3401

merged 4 commits into from
Dec 25, 2015

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 23, 2015

I started out trying to fix the OS X SDK’s Zoom Out button, which refused to disable even as you reach the effective minimum zoom level. I wound up fixing a few related issues:

  • Two active sources can have different minimum and maximum zoom levels. Always use the nearest available zoom level for the source. TransformState has the final say over whether a zoom level is allowed.
  • Even if TransformState::constrainMode is HeightOnly, there isn’t usually a reason to show more than one full revolution of the world at a time. Before this change, osxapp effectively constrained the zoom level based on whether the window was shorter or taller than 512 points. (Maps.app constrains the zoom level even further in standard view, but that’s because its satellite view is projected onto a globe, so it’s more appropriate at low zoom levels.)
  • Fixed Transform::getMinZoom() to account for the constrained zoom level.

These changes have the side effect of fixing an issue in the iOS SDK, in which the minimum zoom level in portrait can be circumvented by zooming out in landscape then rotating the device. Now the two orientations have consistent minimum zoom levels, which fully fixes #1755.

/cc @brunoabinader @friedbunny @zugaldia

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Dec 23, 2015
@1ec5 1ec5 self-assigned this Dec 23, 2015
@1ec5 1ec5 added this to the ios-v3.1.0 milestone Dec 23, 2015
@friedbunny
Copy link
Contributor

Tried this out on iOS and did not notice any issues.

If for whatever reason a source doesn’t cover all the zoom levels allowed by the style – for instance, if different sources have different zoom ranges – use the nearest available zoom level.
Even if the map supports wrapping the world, it isn’t necessary to show more than one full revolution of the world at a time. Removed a redundant zoom level clamp.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing device orientation causes user dot to wander
2 participants