2

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?

4

1 回答 1

0

您能否澄清您是否使用MarkerOptionsor MarkerViewOptions,这些在 SDK 内部是不同的,默认情况下将图标锚定在不同的位置。如果您使用带有默认图标的 MarkerOptions,您会注意到锚点位于中心,因此图标通过在图像底部添加填充来解决此问题。即使用户在标记下方单击,此填充也会导致 onClick 事件发生。

于 2017-05-03T21:08:04.563 回答