Solved! For anyone interested: getMarker is meant to return null if
the overlay item is using the default drawable for that
itemizedoverlay. So if you get a null back from that method, measure
the height of the default one (you can store it in an instance
variable within a subclasses itemizedoverlay so you always know the
default marker drawable) and otherwise measure the height of the
returned drawable.

Nick

On Apr 3, 2:51 am, patbenatar <[email protected]> wrote:
> Hello friends!
>
> 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();
>
> getMarker() is returning null so I never even get into my if statement
> block to get the height.
>
> 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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to