[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:
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user