Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

OnMapClick() and onLocationLayerClick are called one by one #12011

Closed
samoilovich opened this issue May 25, 2018 · 2 comments
Closed

OnMapClick() and onLocationLayerClick are called one by one #12011

samoilovich opened this issue May 25, 2018 · 2 comments
Assignees
Labels
Android Mapbox Maps SDK for Android SEMVER-MAJOR Requires a major release according to Semantic Versioning rules

Comments

@samoilovich
Copy link

Hello

My app has the map. I need to handle clicks on the location marker (blue point for current location) on the map. For the location marker I use custom icon (don't know if it is important or not).
My map has OnMapClickListener and OnLocationLayerClickListener.
And onMapClick() and onLocationLayerClick() are called one by one (both!) if I click on the location marker.
But I need that onMapClick() is not called if I click on the location marker cause it leads to unexpected behavior.

mapbox sdk: com.mapbox.mapboxsdk:mapbox-android-sdk:6.1.1
location layer plugin: com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.2
device: Sumsumg S7 edge. android version 7.0

Could you help with that?
Please let me know if you need any info about code or steps to reproduce.

Thanks

@tobrun
Copy link
Member

tobrun commented May 25, 2018

@samoilovich thank you for reporting this issue, the OnLocationLayerClickListener itself uses an OnMapClickListener. It's expected that this will happen though it's not ideal. To solve this, I'm proposing to change the signature of void OnMapClick to boolean OnMapClick. This would allow a component as a plugin to indicate to the SDK to not further notifty other OnMapClick listeners.

Will have to tag this as a SemVer change as we are changing public API with this one.

cc @LukasPaczos @cammace

@tobrun tobrun added Android Mapbox Maps SDK for Android SEMVER-MAJOR Requires a major release according to Semantic Versioning rules labels May 25, 2018
@tobrun tobrun added this to the android-v7.0.0 milestone May 25, 2018
@tobrun tobrun modified the milestone: android-v7.0.0 Sep 19, 2018
@tobrun
Copy link
Member

tobrun commented Oct 31, 2018

Landed with #13237

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android SEMVER-MAJOR Requires a major release according to Semantic Versioning rules
Projects
None yet
Development

No branches or pull requests

3 participants