public abstract class InfoWindow extends Object
InfoWindow
is a (pop-up-) View that can
be displayed on an MapView
, associated to a
IGeoPoint
.
Typical usage: cartoon-like bubbles displayed when clicking an overlay item (i.e. a
Marker
).
It mimics the InfoWindow class of Google Maps JavaScript API V3.
Main differences are:
This is an abstract class.
MarkerInfoWindow
Modifier and Type | Field and Description |
---|---|
protected boolean |
mIsVisible |
protected MapView |
mMapView |
protected Object |
mRelatedObject |
protected View |
mView |
Constructor and Description |
---|
InfoWindow(int layoutResId,
MapView mapView) |
InfoWindow(View v,
MapView mapView) |
Modifier and Type | Method and Description |
---|---|
void |
close()
hides the info window, which triggers another render of the map
|
static void |
closeAllInfoWindowsOn(MapView mapView)
close all InfoWindows currently opened on this MapView
|
void |
draw()
refresh the infowindow drawing.
|
MapView |
getMapView()
may return null if the info window hasn't been attached yet
|
static ArrayList<InfoWindow> |
getOpenedInfoWindowsOn(MapView mapView)
return all InfoWindows currently opened on this MapView
|
Object |
getRelatedObject() |
View |
getView()
Returns the Android view.
|
boolean |
isOpen() |
abstract void |
onClose() |
void |
onDetach()
this destroys the window and all references to views
|
abstract void |
onOpen(Object item) |
void |
open(Object object,
GeoPoint position,
int offsetX,
int offsetY)
open the InfoWindow at the specified GeoPosition + offset.
|
void |
setRelatedObject(Object relatedObject)
Allows to link an Object (any Object) to this marker.
|
protected View mView
protected boolean mIsVisible
protected MapView mMapView
protected Object mRelatedObject
public InfoWindow(int layoutResId, MapView mapView)
layoutResId
- the id of the view resource.mapView
- the mapview on which is hooked the viewpublic void setRelatedObject(Object relatedObject)
public Object getRelatedObject()
public MapView getMapView()
public View getView()
public void open(Object object, GeoPoint position, int offsetX, int offsetY)
object
- the graphical object on which is hooked the viewposition
- to place the window on the mapoffsetX
- (&offsetY) the offset of the view to the position, in pixels.
This allows to offset the view from the object position.public void draw()
public void close()
public void onDetach()
public boolean isOpen()
public static void closeAllInfoWindowsOn(MapView mapView)
mapView
- public static ArrayList<InfoWindow> getOpenedInfoWindowsOn(MapView mapView)
mapView
- public abstract void onOpen(Object item)
public abstract void onClose()