diff options
author | Tobrun Van Nuland <tobrun.van.nuland@gmail.com> | 2017-07-25 12:50:36 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2017-07-25 14:27:10 +0200 |
commit | a28228013ce83ce115175d0a40b62fe0bfe81559 (patch) | |
tree | a916909f5a4e63f84fc056771109e901066f4d5c | |
parent | 0e0536a8d7203fbf3883c0e148cb509188d2b496 (diff) | |
download | qtlocation-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.java | 10 |
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); |