[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.

This commit is contained in:
Brad Leege
2016-02-03 17:59:44 -06:00
parent 23c6e0f729
commit 932012e931
2 changed files with 18 additions and 4 deletions

View File

@@ -25,12 +25,12 @@ public class MapboxConstants {
/**
* The currently supported minimum zoom level.
*/
public static final double MINIMUM_ZOOM = 0f;
public static final double MINIMUM_ZOOM = 0.0;
/**
* The currently supported maximum zoom level.
*/
public static final double MAXIMUM_ZOOM = 25.0;
public static final double MAXIMUM_ZOOM = 25.5;
/**
* The currently supported maximum tilt value.

View File

@@ -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 {