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-25 14:27:10 +0200
commita28228013ce83ce115175d0a40b62fe0bfe81559 (patch)
treea916909f5a4e63f84fc056771109e901066f4d5c
parent0e0536a8d7203fbf3883c0e148cb509188d2b496 (diff)
downloadqtlocation-mapboxgl-a28228013ce83ce115175d0a40b62fe0bfe81559.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 960f71ca13..edf448ab4f 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
@@ -390,10 +390,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);