summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-10-03 17:19:47 +0200
committerGitHub <noreply@github.com>2016-10-03 17:19:47 +0200
commit4bbdb448fd619ae55a9366556923a5d1aaf8cee7 (patch)
treee161030bc306f0d5414b541e32ab508bbd01b714 /platform
parent132954b56340ff6d883a325c0f64ed7ce1aa3072 (diff)
downloadqtlocation-mapboxgl-4bbdb448fd619ae55a9366556923a5d1aaf8cee7.tar.gz
[android] - make MyLocationView responsible for converting tilt to degrees. (#6558)
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java
index 2bc03d7ebf..24ab3e7346 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java
@@ -36,6 +36,7 @@ import com.mapbox.mapboxsdk.location.LocationListener;
import com.mapbox.mapboxsdk.location.LocationServices;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.Projection;
+import com.mapbox.mapboxsdk.utils.MathUtils;
import java.lang.ref.WeakReference;
@@ -314,7 +315,7 @@ public class MyLocationView extends View {
}
public void setCameraPosition(CameraPosition position) {
- setTilt(position.tilt);
+ setTilt(MathUtils.clamp(Math.toDegrees(position.tilt), 0.0, 60.0));
setBearing(position.bearing);
}