Android

com.google.android.maps.OverlayItem

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

The basic component of any ItemizedOverlay.

Summary

Constants

      Value  
int  ITEM_STATE_FOCUSED_MASK  State bitset bit: Indicates the overlay item is in the focused state.  0x00000004 
int  ITEM_STATE_PRESSED_MASK  State bitset bit: indicates the overlay item is in the pressed state.  0x00000001 
int  ITEM_STATE_SELECTED_MASK  State bitset bit: Indicates the overlay item is in the selected state.  0x00000002 

Fields

protected      Drawable  mMarker  The overlay marker used to indicate this item. 
protected    final  GeoPoint  mPoint  Position of this item. 
protected    final  String  mSnippet  Snippet text of this item. 
protected    final  String  mTitle  Title text of this item. 

Public Constructors

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

Public Methods

          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.
          String  getSnippet()
Returns the snippet text of this overlay.
          String  getTitle()
Returns the title text of this overlay.
          String  routableAddress()
Returns the position of this item in a map-routable format.
          void  setMarker(Drawable marker)
Sets the marker to be used when drawing this item on the map.
      static    void  setState(Drawable drawable, int stateBitset)
Sets the state of a drawable to match a given state bitset.
Methods inherited from class java.lang.Object

Details

Constants

public static final int ITEM_STATE_FOCUSED_MASK

State bitset bit: Indicates the overlay item is in the focused state.
Constant Value: 4 (0x00000004)

public static final int ITEM_STATE_PRESSED_MASK

State bitset bit: indicates the overlay item is in the pressed state.
Constant Value: 1 (0x00000001)

public static final int ITEM_STATE_SELECTED_MASK

State bitset bit: Indicates the overlay item is in the selected state.
Constant Value: 2 (0x00000002)

Fields

protected Drawable mMarker

The overlay marker used to indicate this item.

protected final GeoPoint mPoint

Position of this item.

protected final String mSnippet

Snippet text of this item.

protected final String mTitle

Title text of this item.

Public Constructors

public OverlayItem(GeoPoint point, String title, String snippet)

Construct an overlay item.

Parameters

point Position of the item.
title Title text.
snippet Snippet text.

Public Methods

public 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(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.

public GeoPoint getPoint()

Returns the GeoPoint of this overlay.

Returns

  • The GeoPoint.

public String getSnippet()

Returns the snippet text of this overlay.

Returns

  • The snippet.

public String getTitle()

Returns the title text of this overlay.

Returns

  • The title.

public 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).

public void setMarker(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, state_pressed, state_selected and state_focused attributes.

public static void setState(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 state_pressed, state_selected and state_focused attributes, and then calling setState(int[]).

Parameters

drawable The drawable to modify.
stateBitset The state bitset to set.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48