I’m having some trouble getting a hold of the drawable a certain OverlayItem is using so I can calculate the height of it and properly offset the note that shows onTap. Here is my code to try to get that drawable:
Drawable marker = item.getMarker(android.R.attr.state_focused);
if (marker != null) int markerHeight = marker.getIntrinsicHeight();
marker ends up null.
I’m using a drawable XML file with a selector for the different states of the OverlayItem’s drawable. In it I’m specifying a drawable for the null state, state_focused, and state_pressed.
Thanks for any help!
-Nick
According to the documentation about getMarker:
Therefore all you need to do is to pre-calculate the height of the default marker, store it somewhere and return it in case null is returned.
I have also find this discussion about OverlayItem and ItemizedOverlay useful.