2
votes

I have serveral MarkerOptions markers added via mapboxMap.addMarker(myMarkerOptions). The issue is that a markers onClick event is fired even when the user taps outside of the marker bounds. I've had this issue with both custom marker icons and the mapbox default icon. Very annoying when there are multiple markers close by as the user may think they've tapped one but will see details for another!

enter image description here

Has anyone seen/fixed this? Maybe I can specify a custom hit rect as a workaround?

1
Any solution for this? - Himesh goswami
@HimeshGoswami It's been confirmed as a bug but no one can bother to fix it or the many buggy basic features in the Android Mapbox SDK. And their tech support, even for a premium plan customer, was useless. My solution was to give up and start porting to Google Maps. - sham

1 Answers

0
votes

Could you clarify on whether you are using MarkerOptions or MarkerViewOptions, these are different inside the SDK and anchor the icon at different positions by default. If you are using MarkerOptions with the default icon, you'll notice that the anchoring is located at the center and therefore the icon accounts for this by adding padding to the bottom of the image. This padding causes the onClick event to occur even if the user clicks below the marker.