summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java8
1 files changed, 6 insertions, 2 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 f4b1bca251..57f8c61f7e 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
@@ -427,7 +427,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
@Override
public boolean onTouchEvent(MotionEvent event) {
- if (!isMapInitialized() || !isZoomButtonControllerInitialized()) {
+ if (!isMapInitialized() || !isZoomButtonControllerInitialized() || !isGestureDetectorInitialized()) {
return super.onTouchEvent(event);
}
@@ -459,7 +459,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
- if (mapGestureDetector == null) {
+ if (!isGestureDetectorInitialized()) {
return super.onGenericMotionEvent(event);
}
return mapGestureDetector.onGenericMotionEvent(event) || super.onGenericMotionEvent(event);
@@ -676,6 +676,10 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
return mapZoomButtonController != null;
}
+ private boolean isGestureDetectorInitialized() {
+ return mapGestureDetector != null;
+ }
+
MapboxMap getMapboxMap() {
return mapboxMap;
}