-
public abstract class InfoWindoworg.osmdroid.views.overlay.infowindow.InfoWindow is a (pop-up-) View that can be displayed on an org.osmdroid.views.MapView, associated to a org.osmdroid.api.IGeoPoint.
Typical usage: cartoon-like bubbles displayed when clicking an overlay item (i.e. a org.osmdroid.views.overlay.Marker). It mimics the InfoWindow class of Google Maps JavaScript API V3. Main differences are:
- Structure and content of the view is let to the responsibility of the caller.
- The same InfoWindow can be associated to many items.
This is an abstract class.
-
-
Constructor Summary
Constructors Constructor Description InfoWindow(int layoutResId, MapView mapView)InfoWindow(View v, MapView mapView)
-
Method Summary
Modifier and Type Method Description voidsetRelatedObject(Object relatedObject)Allows to link an Object (any Object) to this marker.This is particularly useful to handle custom InfoWindow. ObjectgetRelatedObject()MapViewgetMapView()may return null if the info window hasn't been attached yet ViewgetView()Returns the Android view. voidopen(Object object, GeoPoint position, int offsetX, int offsetY)open the InfoWindow at the specified GeoPosition + offset.If it was already opened, close it before reopening. voiddraw()refresh the infowindow drawing. voidclose()hides the info window, which triggers another render of the map voidonDetach()this destroys the window and all references to views booleanisOpen()static voidcloseAllInfoWindowsOn(MapView mapView)close all InfoWindows currently opened on this MapView static ArrayList<InfoWindow>getOpenedInfoWindowsOn(MapView mapView)return all InfoWindows currently opened on this MapView abstract voidonOpen(Object item)abstract voidonClose()-
-
Method Detail
-
setRelatedObject
void setRelatedObject(Object relatedObject)
Allows to link an Object (any Object) to this marker.This is particularly useful to handle custom InfoWindow.
-
getRelatedObject
Object getRelatedObject()
-
getMapView
MapView getMapView()
may return null if the info window hasn't been attached yet
-
open
void open(Object object, GeoPoint position, int offsetX, int offsetY)
open the InfoWindow at the specified GeoPosition + offset.If it was already opened, close it before reopening.
- Parameters:
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.
-
draw
void draw()
refresh the infowindow drawing. Must be called every time the view changes (drag, zoom,...).Best practice is to call this method in the draw method of its overlay.
-
close
void close()
hides the info window, which triggers another render of the map
-
onDetach
void onDetach()
this destroys the window and all references to views
-
isOpen
boolean isOpen()
-
closeAllInfoWindowsOn
static void closeAllInfoWindowsOn(MapView mapView)
close all InfoWindows currently opened on this MapView
-
getOpenedInfoWindowsOn
static ArrayList<InfoWindow> getOpenedInfoWindowsOn(MapView mapView)
return all InfoWindows currently opened on this MapView
-
onClose
abstract void onClose()
-
-
-
-