diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-11-09 10:51:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 10:51:40 +0100 |
commit | 4030e86c33c8863c4c255201e6a7f3ff447000ed (patch) | |
tree | f384b1764c38cd2969372bb144dafffcfaef8690 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera | |
parent | 772324e8f2a316bf82774732dd60bb7af5acdb18 (diff) | |
download | qtlocation-mapboxgl-4030e86c33c8863c4c255201e6a7f3ff447000ed.tar.gz |
[android] - fix inconsistency of float usage in CameraPosition and CameraUpdateFactory (#6941)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera')
2 files changed, 14 insertions, 14 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java index fabf66af38..fe6792a0a1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java @@ -42,12 +42,12 @@ public final class CameraPosition implements Parcelable { public final LatLng target; /** - * The angle, in degrees, of the camera angle from the nadir (directly facing the Earth). See tilt(float) for details of restrictions on the range of values. + * The angle, in degrees, of the camera angle from the nadir (directly facing the Earth). See tilt(double) for details of restrictions on the range of values. */ public final double tilt; /** - * Zoom level near the center of the screen. See zoom(float) for the definition of the camera's zoom level. + * Zoom level near the center of the screen. See zoom(double) for the definition of the camera's zoom level. */ public final double zoom; @@ -55,8 +55,8 @@ public final class CameraPosition implements Parcelable { * Constructs a CameraPosition. * * @param target The target location to align with the center of the screen. - * @param zoom Zoom level at target. See zoom(float) for details of restrictions. - * @param tilt The camera angle, in degrees, from the nadir (directly down). See tilt(float) for details of restrictions. + * @param zoom Zoom level at target. See zoom(double) for details of restrictions. + * @param tilt The camera angle, in degrees, from the nadir (directly down). See tilt(double) for details of restrictions. * @param bearing Direction that the camera is pointing in, in degrees clockwise from north. This value will be normalized to be within 0 degrees inclusive and 360 degrees exclusive. * @throws NullPointerException if target is null * @throws IllegalArgumentException if tilt is outside the range of 0 to 90 degrees inclusive. @@ -206,7 +206,7 @@ public final class CameraPosition implements Parcelable { target(new LatLng(nativeCameraValues[0], nativeCameraValues[1])); bearing(convertNativeBearing(nativeCameraValues[2])); tilt(nativeCameraValues[3]); - zoom((float) nativeCameraValues[4]); + zoom(nativeCameraValues[4]); } } @@ -260,7 +260,7 @@ public final class CameraPosition implements Parcelable { * @return Builder */ public Builder tilt(double tilt) { - this.tilt = (float) MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT); + this.tilt = MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT); return this; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java index db05486bc2..8ffb34ceed 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java @@ -81,7 +81,7 @@ public final class CameraUpdateFactory { * @param zoom Zoom level to change to * @return CameraUpdate Final Camera Position */ - public static CameraUpdate newLatLngZoom(@NonNull LatLng latLng, float zoom) { + public static CameraUpdate newLatLngZoom(@NonNull LatLng latLng, double zoom) { return new CameraPositionUpdate(-1, latLng, -1, zoom); } @@ -104,7 +104,7 @@ public final class CameraUpdateFactory { * @param focus Focus point of zoom * @return CameraUpdate Final Camera Position */ - public static CameraUpdate zoomBy(float amount, Point focus) { + public static CameraUpdate zoomBy(double amount, Point focus) { return new ZoomUpdate(amount, focus.x, focus.y); } @@ -114,7 +114,7 @@ public final class CameraUpdateFactory { * @param amount Amount of zoom level to change with * @return CameraUpdate Final Camera Position */ - public static CameraUpdate zoomBy(float amount) { + public static CameraUpdate zoomBy(double amount) { return new ZoomUpdate(ZoomUpdate.ZOOM_BY, amount); } @@ -142,7 +142,7 @@ public final class CameraUpdateFactory { * @param zoom Zoom level to change to * @return CameraUpdate Final Camera Position */ - public static CameraUpdate zoomTo(float zoom) { + public static CameraUpdate zoomTo(double zoom) { return new ZoomUpdate(ZoomUpdate.ZOOM_TO, zoom); } @@ -259,7 +259,7 @@ public final class CameraUpdateFactory { float scaleY = (uiSettings.getHeight() - padding.top - padding.bottom) / height; minScale = scaleX < scaleY ? scaleX : scaleY; zoom = projection.calculateZoom(minScale); - zoom = MathUtils.clamp(zoom, (float) mapboxMap.getMinZoom(), (float) mapboxMap.getMaxZoom()); + zoom = MathUtils.clamp(zoom, mapboxMap.getMinZoom(), mapboxMap.getMaxZoom()); } // Calculate the center point @@ -271,7 +271,7 @@ public final class CameraUpdateFactory { return new CameraPosition.Builder() .target(center) - .zoom((float) zoom) + .zoom(zoom) .tilt(0) .bearing(0) .build(); @@ -335,12 +335,12 @@ public final class CameraUpdateFactory { this.zoom = 0; } - ZoomUpdate(@Type int type, float zoom) { + ZoomUpdate(@Type int type, double zoom) { this.type = type; this.zoom = zoom; } - ZoomUpdate(float zoom, float x, float y) { + ZoomUpdate(double zoom, float x, float y) { this.type = ZOOM_TO_POINT; this.zoom = zoom; this.x = x; |