summaryrefslogtreecommitdiff
path: root/src/mbgl/map
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2016-02-03 17:59:44 -0600
committerBrad Leege <bleege@gmail.com>2016-02-03 17:59:44 -0600
commit932012e931930896ef492b3b920ec1288ef5625c (patch)
tree36d2ec2f7a5820d16a91535f5b7bfeaed965785d /src/mbgl/map
parent23c6e0f72929038f80257d5986a5fa5b282ca37b (diff)
downloadqtlocation-mapboxgl-932012e931930896ef492b3b920ec1288ef5625c.tar.gz
[android][core] #509 - Setting Min and Max Zooms warning annotations in Android. Clamping Min and Max zooms at Core GL for all platforms to use at runtime.
Diffstat (limited to 'src/mbgl/map')
-rw-r--r--src/mbgl/map/transform_state.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp
index 92a35f7faa..41f71197c4 100644
--- a/src/mbgl/map/transform_state.cpp
+++ b/src/mbgl/map/transform_state.cpp
@@ -161,7 +161,14 @@ double TransformState::getScale() const {
}
void TransformState::setMinZoom(const double minZoom) {
- min_scale = zoomScale(minZoom);
+ double zoom = minZoom;
+ if (minZoom > 25.5) {
+ zoom = 25.5;
+ }
+ if (minZoom < 0) {
+ zoom = 0.0;
+ }
+ min_scale = zoomScale(zoom);
}
double TransformState::getMinZoom() const {
@@ -174,7 +181,14 @@ double TransformState::getMinZoom() const {
}
void TransformState::setMaxZoom(const double maxZoom) {
- max_scale = zoomScale(maxZoom);
+ double zoom = maxZoom;
+ if (maxZoom > 25.5) {
+ zoom = 25.5;
+ }
+ if (maxZoom < 0) {
+ zoom = 0.0;
+ }
+ max_scale = zoomScale(zoom);
}
double TransformState::getMaxZoom() const {