summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun Van Nuland <tobrun.van.nuland@gmail.com>2017-07-25 12:50:36 +0200
committerTobrun <tobrun@mapbox.com>2017-07-28 12:06:53 +0200
commit009da507fa780d111bb574154840a061ab284c8f (patch)
tree06399de8957645f89a34ed9f5b8be4c074236769
parent635a3f21a0373335d4a334f5bb487251f027f47c (diff)
downloadqtlocation-mapboxgl-009da507fa780d111bb574154840a061ab284c8f.tar.gz
[android] - don't query for shape annotations if none were added
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java
index 251e5afabe..712ab67de0 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java
@@ -648,10 +648,12 @@ class AnnotationManager {
//
boolean onTap(PointF tapPoint) {
- ShapeAnnotationHit shapeAnnotationHit = getShapeAnnotationHitFromTap(tapPoint);
- long shapeAnnotationId = new ShapeAnnotationHitResolver(mapboxMap).execute(shapeAnnotationHit);
- if (shapeAnnotationId != NO_ANNOTATION_ID) {
- handleClickForShapeAnnotation(shapeAnnotationId);
+ if (!shapeAnnotationIds.isEmpty()) {
+ ShapeAnnotationHit shapeAnnotationHit = getShapeAnnotationHitFromTap(tapPoint);
+ long shapeAnnotationId = new ShapeAnnotationHitResolver(mapboxMap).execute(shapeAnnotationHit);
+ if (shapeAnnotationId != NO_ANNOTATION_ID) {
+ handleClickForShapeAnnotation(shapeAnnotationId);
+ }
}
MarkerHit markerHit = getMarkerHitFromTouchArea(tapPoint);