GoogleMaps: custom ItemizedOverlay and OverlayItem, the correct way to show different marker

前端 未结 1 1901
梦如初夏
梦如初夏 2020-12-15 02:17

I\'ve been searching long for clear informations about the right way of extending ItemizedOverlay and OverlayItem, but the result I get does not satisfy me yet. In a few wor

相关标签:
1条回答
  • 2020-12-15 02:58

    Ok, after repeated tests it seems that this:

    drawable.setBounds(-drawable.getIntrinsicWidth()/2, -drawable.getIntrinsicHeight(), drawable.getIntrinsicWidth() /2, 0);
    

    placed in the getMarker method of OverlayItem for the drawable that has to ber returned does the job (as boundBottomCenter does in ItemizedOverlay). Now all is working fine, and even the non-default markers are displayed correctly.

    Cheers!

    0 讨论(0)
提交回复
热议问题