summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-10-05 22:55:54 +0200
committerGitHub <noreply@github.com>2016-10-05 22:55:54 +0200
commitc2333658f0e756c306fffafed713a5e3bd61155f (patch)
treeb57cd4da0b3157e25587704b21f298529c5b676a
parentd96aabec436f09e8bb7cc31f35e7b681fcdd07f6 (diff)
downloadqtlocation-mapboxgl-c2333658f0e756c306fffafed713a5e3bd61155f.tar.gz
[android] - invalidate focal point when setting MyLocationView padding (#6413)
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 317ccbf1a5..0d09892cbc 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -1283,6 +1283,12 @@ public class MapView extends FrameLayout {
public void invalidateContentPadding() {
setContentPadding(contentPaddingLeft, contentPaddingTop, contentPaddingRight, contentPaddingBottom);
+
+ if (!mapboxMap.getTrackingSettings().isLocationTrackingDisabled()) {
+ setFocalPoint(new PointF(myLocationView.getCenterX(), myLocationView.getCenterY()));
+ } else {
+ setFocalPoint(null);
+ }
}
double getMetersPerPixelAtLatitude(@FloatRange(from = -180, to = 180) double latitude) {