onMarkerClick is only called after the second click
Platform: Android 6.0.1 Mapbox SDK version: 5.0.2
Steps to trigger behavior
- Add an OnMarkerClick event listener to your mapboxmap
- Create a marker on your map with a title and snippet
- Click on marker
Expected behavior
OnMarkerClick is called immediately
Actual behavior
The info bubble is shown on the first click. Then on the second click, the bubble is hidden and OnMarkerClick is called
Google Pixel Android 7.1.2 Mapbox 5.0.2
I'm seeing the same issue even without a snippet/title. But i've noticed when hooking OnMarkerViewClickListener from the maps MarkerViewManager it works as expected.
Maybe you could use it for now @SimonPSH.
mapboxMap.getMarkerViewManager().setOnMarkerViewClickListener(this);
As mentioned by @DejanRistic, you probably need to hook into OnMarkerViewClickListener. When it comes to firing a click event when the InfoWindow is open, this is considered a worked as designed to allow customizing the click event occurring on the Marker. For example if you return true, the infowindow wouldn't be deselected. You can check the state of the InfoWindow with marker.isInfoWindowShown().
Let us know if you have any more questions or suggestions, but closing this for now.