com.google.android.maps
Class OverlayItem

java.lang.Object
  extended by com.google.android.maps.OverlayItem

public class OverlayItem
extends java.lang.Object

The basic component of any ItemizedOverlay.


Field Summary
static int ITEM_STATE_FOCUSED_MASK
          State bitset bit: Indicates the overlay item is in the focused state.
static int ITEM_STATE_PRESSED_MASK
          State bitset bit: indicates the overlay item is in the pressed state.
static int ITEM_STATE_SELECTED_MASK
          State bitset bit: Indicates the overlay item is in the selected state.
protected  android.graphics.drawable.Drawable mMarker
          The overlay marker used to indicate this item.
protected  GeoPoint mPoint
          Position of this item.
protected  java.lang.String mSnippet
          Snippet text of this item.
protected  java.lang.String mTitle
          Title text of this item.
 
Constructor Summary
OverlayItem(GeoPoint point, java.lang.String title, java.lang.String snippet)
          Construct an overlay item.
 
Method Summary
 android.graphics.drawable.Drawable getMarker(int stateBitset)
          Returns the marker that should be used when drawing this item on the map.
 GeoPoint getPoint()
          Returns the GeoPoint of this overlay.
 java.lang.String getSnippet()
          Returns the snippet text of this overlay.
 java.lang.String getTitle()
          Returns the title text of this overlay.
 java.lang.String routableAddress()
          Returns the position of this item in a map-routable format.
 void setMarker(android.graphics.drawable.Drawable marker)
          Sets the marker to be used when drawing this item on the map.
static void setState(android.graphics.drawable.Drawable drawable, int stateBitset)
          Sets the state of a drawable to match a given state bitset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPoint

protected final GeoPoint mPoint
Position of this item.


mTitle

protected final java.lang.String mTitle
Title text of this item.


mSnippet

protected final java.lang.String mSnippet
Snippet text of this item.


mMarker

protected android.graphics.drawable.Drawable mMarker
The overlay marker used to indicate this item.


ITEM_STATE_FOCUSED_MASK

public static final int ITEM_STATE_FOCUSED_MASK
State bitset bit: Indicates the overlay item is in the focused state.

See Also:
Constant Field Values

ITEM_STATE_SELECTED_MASK

public static final int ITEM_STATE_SELECTED_MASK
State bitset bit: Indicates the overlay item is in the selected state.

See Also:
Constant Field Values

ITEM_STATE_PRESSED_MASK

public static final int ITEM_STATE_PRESSED_MASK
State bitset bit: indicates the overlay item is in the pressed state.

See Also:
Constant Field Values
Constructor Detail

OverlayItem

public OverlayItem(GeoPoint point,
                   java.lang.String title,
                   java.lang.String snippet)
Construct an overlay item.

Parameters:
point - Position of the item.
title - Title text.
snippet - Snippet text.
Method Detail

setMarker

public void setMarker(android.graphics.drawable.Drawable marker)
Sets the marker to be used when drawing this item on the map. Setting the marker to null will cause the default marker to be drawn (the marker is null by default, so you can just skip this, instead). The marker may be drawn using any combination of the null, R.attr.state_pressed, R.attr.state_selected and R.attr.state_focused attributes.


getMarker

public android.graphics.drawable.Drawable getMarker(int stateBitset)
Returns the marker that should be used when drawing this item on the map. A null value means that the default marker should be drawn. Different markers can be returned for different states. The different markers can have different bounds. The default behavior is to call setState(android.graphics.drawable.Drawable, int) on the overlay item's marker, if it exists, and then return it.

Parameters:
stateBitset - The current state.
Returns:
The marker for the current state, or null if the default marker for the overlay should be used.

setState

public static void setState(android.graphics.drawable.Drawable drawable,
                            int stateBitset)
Sets the state of a drawable to match a given state bitset. This is done by converting the state bitset bits into a state set of R.attr.state_pressed, R.attr.state_selected and R.attr.state_focused attributes, and then calling Drawable.setState(int[]).

Parameters:
drawable - The drawable to modify.
stateBitset - The state bitset to set.

getTitle

public java.lang.String getTitle()
Returns the title text of this overlay.

Returns:
The title.

getSnippet

public java.lang.String getSnippet()
Returns the snippet text of this overlay.

Returns:
The snippet.

getPoint

public GeoPoint getPoint()
Returns the GeoPoint of this overlay.

Returns:
The GeoPoint.

routableAddress

public java.lang.String routableAddress()
Returns the position of this item in a map-routable format.

Returns:
By default, a String with the latitude and longitude (comma-separated), in degrees (not microdegrees).