java.lang.Object | ||
↳ | com.google.android.maps.Overlay | |
↳ | sofia.maps.AbstractListOverlay<Item> |
Known Direct Subclasses
MarkerOverlay<Item>,
RouteOverlay<Item>
|
An abstract overlay that supports displaying elements in a list of arbitrary objects. These objects can have annotations on methods to provide marker information (ProvidesMarkerGeoPoint, ProvidesMarkerTitle, etc.), or alternatively a "decorator" object can be specified that provides this information given an item on the map.
AbstractListOverlay
provides no rendering of its own, only methods
by which subclasses can access the decorations for the items that should be
displayed on the map. Sofia comes with two concrete subclasses that should
be suitable for most users:
This class provides support for displaying an informational "balloon"
containing the title and content of the item when it is tapped, but it is
disabled by default for this class. The MarkerOverlay class enables
it by default, and the RouteOverlay class leaves is disabled. Custom
subclasses that want to enable this functionality should call
setShowsBalloonWhenClicked(boolean)
.
Users can implement the following methods in the context that owns this
overlay's MapView
(for example, their MapScreen class) to
receive event notifications:
[void|boolean] mapItemWasClicked(Item item)
void mapBalloonWasClicked(Item item)
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | AbstractListOverlay.AnnotationDecorator |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.android.maps.Overlay
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected static final AbstractListOverlay.AnnotationDecorator | defaultDecorator |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractListOverlay(MapView mapView, List<Item> list)
Initializes a new
AbstractListOverlay . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Object | getDecorator() | ||||||||||
List<Item> |
getList()
Gets the list of objects to display in the overlay.
| ||||||||||
MapView |
getMapView()
Gets the MapView on which this overlay will be displayed.
| ||||||||||
boolean | onTap(GeoPoint tapPoint, MapView mapView) | ||||||||||
void | setDecorator(Object decorator) | ||||||||||
void |
setList(List<Item> newList)
Sets the list of objects to display in the overlay.
| ||||||||||
void | setShowsBalloonWhenClicked(boolean showBalloon) | ||||||||||
boolean | showsBalloonWhenClicked() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Rect | getItemBounds(Point point, Item item) | ||||||||||
Object | getItemContent(Item item) | ||||||||||
GeoPoint | getItemGeoPoint(Item item) | ||||||||||
String | getItemTitle(Item item) | ||||||||||
boolean |
hitTest(GeoPoint tapPoint, GeoPoint queryPoint, Item item)
Determines if the specified geopoint falls anywhere within the bounds of
the marker image.
| ||||||||||
void | openBalloon(GeoPoint geoPoint, Item item) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.android.maps.Overlay
| |||||||||||
From class
java.lang.Object
|
Initializes a new AbstractListOverlay
.
mapView | the MapView to which this overlay will be added |
---|---|
list | the list of objects to display in the overlay |
Gets the list of objects to display in the overlay.
Gets the MapView on which this overlay will be displayed.
Sets the list of objects to display in the overlay. Calling this method will automatically repaint the map view; you do not need to do so separately.
newList | the new list of objects to display in the overlay |
---|
Determines if the specified geopoint falls anywhere within the bounds of the marker image.