summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
index af48b5c4d4..9efa2b81fd 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
@@ -584,6 +584,11 @@ public final class LocationComponent {
/**
* Adds a listener that gets invoked when the user clicks the displayed location.
+ * <p>
+ * If there are registered location click listeners and the location is clicked,
+ * only {@link OnLocationClickListener#onLocationComponentClick()} is going to be delivered,
+ * {@link com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener#onMapClick(LatLng)} is going to be consumed
+ * and not pushed to the listeners registered after the component's activation.
*
* @param listener The location click listener that is invoked when the
* location is clicked
@@ -603,6 +608,11 @@ public final class LocationComponent {
/**
* Adds a listener that gets invoked when the user long clicks the displayed location.
+ * <p>
+ * If there are registered location long click listeners and the location is long clicked,
+ * only {@link OnLocationLongClickListener#onLocationComponentLongClick()} is going to be delivered,
+ * {@link com.mapbox.mapboxsdk.maps.MapboxMap.OnMapLongClickListener#onMapLongClick(LatLng)} is going to be consumed
+ * and not pushed to the listeners registered after the component's activation.
*
* @param listener The location click listener that is invoked when the
* location is clicked
@@ -918,23 +928,27 @@ public final class LocationComponent {
private OnMapClickListener onMapClickListener = new OnMapClickListener() {
@Override
- public void onMapClick(@NonNull LatLng point) {
+ public boolean onMapClick(@NonNull LatLng point) {
if (!onLocationClickListeners.isEmpty() && locationLayerController.onMapClick(point)) {
for (OnLocationClickListener listener : onLocationClickListeners) {
listener.onLocationComponentClick();
}
+ return true;
}
+ return false;
}
};
private MapboxMap.OnMapLongClickListener onMapLongClickListener = new MapboxMap.OnMapLongClickListener() {
@Override
- public void onMapLongClick(@NonNull LatLng point) {
+ public boolean onMapLongClick(@NonNull LatLng point) {
if (!onLocationLongClickListeners.isEmpty() && locationLayerController.onMapClick(point)) {
for (OnLocationLongClickListener listener : onLocationLongClickListeners) {
listener.onLocationComponentLongClick();
}
+ return true;
}
+ return false;
}
};