
public class Marker extends OverlayWithIW
InfoWindow (a bubble)
Mimics the Marker class from Google Maps Android API v2 as much as possible. Main differences:| Modifier and Type | Class and Description |
|---|---|
static interface |
Marker.OnMarkerClickListener |
static interface |
Marker.OnMarkerDragListener |
Overlay.Snappable| Modifier and Type | Field and Description |
|---|---|
static float |
ANCHOR_BOTTOM
Usual values in the (U,V) coordinates system of the icon image
|
static float |
ANCHOR_CENTER
Usual values in the (U,V) coordinates system of the icon image
|
static float |
ANCHOR_LEFT
Usual values in the (U,V) coordinates system of the icon image
|
static float |
ANCHOR_RIGHT
Usual values in the (U,V) coordinates system of the icon image
|
static float |
ANCHOR_TOP
Usual values in the (U,V) coordinates system of the icon image
|
static boolean |
ENABLE_TEXT_LABELS_WHEN_NO_IMAGE
this is an OPT IN feature that was used for kml parsing with osmbonuspack (on a remote branch)
that set the image icon of a kml marker to a text label if no image url was provided.
|
protected float |
mAlpha |
protected float |
mAnchorU |
protected float |
mAnchorV |
protected float |
mBearing |
protected static Drawable |
mDefaultIcon |
protected static MarkerInfoWindow |
mDefaultInfoWindow |
protected boolean |
mDraggable |
protected boolean |
mFlat |
protected Drawable |
mIcon |
protected Drawable |
mImage |
protected boolean |
mIsDragged |
protected float |
mIWAnchorU |
protected float |
mIWAnchorV |
protected Marker.OnMarkerClickListener |
mOnMarkerClickListener |
protected Marker.OnMarkerDragListener |
mOnMarkerDragListener |
protected boolean |
mPanToView |
protected GeoPoint |
mPosition |
protected Point |
mPositionPixels |
protected int |
mTextLabelBackgroundColor |
protected int |
mTextLabelFontSize |
protected int |
mTextLabelForegroundColor |
protected Resources |
resource |
mInfoWindow, mRelatedObject, mSnippet, mSubDescription, mTitleSHADOW_X_SKEW, SHADOW_Y_SCALEDEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET| Constructor and Description |
|---|
Marker(MapView mapView) |
Marker(MapView mapView,
Context resourceProxy) |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanDefaults()
reference https://github.com/MKergall/osmbonuspack/pull/210
|
void |
draw(Canvas canvas,
MapView mapView,
boolean shadow)
Draw the overlay over the map.
|
float |
getAlpha() |
Drawable |
getImage()
get the image to be shown in the InfoWindow - this is not the marker icon
|
GeoPoint |
getPosition() |
float |
getRotation() |
int |
getTextLabelBackgroundColor() |
int |
getTextLabelFontSize() |
int |
getTextLabelForegroundColor() |
boolean |
hitTest(MotionEvent event,
MapView mapView) |
boolean |
isDraggable() |
boolean |
isFlat() |
boolean |
isInfoWindowShown() |
void |
moveToEventPosition(MotionEvent event,
MapView mapView) |
void |
onDetach(MapView mapView)
Null out the static references when the MapView is detached to prevent memory leaks.
|
boolean |
onLongPress(MotionEvent event,
MapView mapView)
By default does nothing (
return false). |
protected boolean |
onMarkerClickDefault(Marker marker,
MapView mapView)
default behaviour when no click listener is set
|
boolean |
onSingleTapConfirmed(MotionEvent event,
MapView mapView)
By default does nothing (
return false). |
boolean |
onTouchEvent(MotionEvent event,
MapView mapView)
You can prevent all(!) other Touch-related events from happening!
By default does nothing ( return false). |
void |
remove(MapView mapView)
Removes this Marker from the MapView.
|
void |
setAlpha(float alpha) |
void |
setAnchor(float anchorU,
float anchorV) |
void |
setDraggable(boolean draggable) |
void |
setFlat(boolean flat) |
void |
setIcon(Drawable icon)
Sets the icon for the marker.
|
void |
setImage(Drawable image)
set an image to be shown in the InfoWindow - this is not the marker icon
|
void |
setInfoWindow(MarkerInfoWindow infoWindow)
Set the InfoWindow to be used.
|
void |
setInfoWindowAnchor(float anchorU,
float anchorV) |
void |
setOnMarkerClickListener(Marker.OnMarkerClickListener listener) |
void |
setOnMarkerDragListener(Marker.OnMarkerDragListener listener) |
void |
setPanToView(boolean panToView)
If set to true, when clicking the marker, the map will be centered on the marker position.
|
void |
setPosition(GeoPoint position) |
void |
setRotation(float rotation) |
void |
setTextLabelBackgroundColor(int mTextLabelBackgroundColor) |
void |
setTextLabelFontSize(int mTextLabelFontSize) |
void |
setTextLabelForegroundColor(int mTextLabelForegroundColor) |
void |
showInfoWindow() |
closeInfoWindow, getInfoWindow, getRelatedObject, getSnippet, getSubDescription, getTitle, isInfoWindowOpen, onDestroy, setInfoWindow, setRelatedObject, setSnippet, setSubDescription, setTitledrawAt, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onScroll, onShowPress, onSingleTapUp, onTrackballEvent, setEnabledpublic static boolean ENABLE_TEXT_LABELS_WHEN_NO_IMAGE
protected int mTextLabelBackgroundColor
protected int mTextLabelForegroundColor
protected int mTextLabelFontSize
protected Drawable mIcon
protected GeoPoint mPosition
protected float mBearing
protected float mAnchorU
protected float mAnchorV
protected float mIWAnchorU
protected float mIWAnchorV
protected float mAlpha
protected boolean mDraggable
protected boolean mIsDragged
protected boolean mFlat
protected Marker.OnMarkerClickListener mOnMarkerClickListener
protected Marker.OnMarkerDragListener mOnMarkerDragListener
protected Drawable mImage
protected boolean mPanToView
protected Point mPositionPixels
protected static MarkerInfoWindow mDefaultInfoWindow
protected static Drawable mDefaultIcon
protected Resources resource
public static final float ANCHOR_CENTER
public static final float ANCHOR_LEFT
public static final float ANCHOR_TOP
public static final float ANCHOR_RIGHT
public static final float ANCHOR_BOTTOM
public Marker(MapView mapView)
public Marker(MapView mapView, Context resourceProxy)
public void setIcon(Drawable icon)
icon - if null, the default osmdroid marker is used.public GeoPoint getPosition()
public void setPosition(GeoPoint position)
public float getRotation()
public void setRotation(float rotation)
public void setAnchor(float anchorU,
float anchorV)
public void setInfoWindowAnchor(float anchorU,
float anchorV)
public void setAlpha(float alpha)
public float getAlpha()
public void setDraggable(boolean draggable)
public boolean isDraggable()
public void setFlat(boolean flat)
public boolean isFlat()
public void remove(MapView mapView)
mapView - public void setOnMarkerClickListener(Marker.OnMarkerClickListener listener)
public void setOnMarkerDragListener(Marker.OnMarkerDragListener listener)
public void setImage(Drawable image)
public Drawable getImage()
public void setInfoWindow(MarkerInfoWindow infoWindow)
public void setPanToView(boolean panToView)
public void showInfoWindow()
public boolean isInfoWindowShown()
public void draw(Canvas canvas,
MapView mapView,
boolean shadow)
Overlaypublic void onDetach(MapView mapView)
public static void cleanDefaults()
public boolean hitTest(MotionEvent event,
MapView mapView)
public boolean onSingleTapConfirmed(MotionEvent event,
MapView mapView)
Overlayreturn false). If you handled the Event, return true
, otherwise return false. If you returned true none of the following Overlays
or the underlying MapView has the chance to handle this event.onSingleTapConfirmed in class Overlaypublic void moveToEventPosition(MotionEvent event,
MapView mapView)
public boolean onLongPress(MotionEvent event,
MapView mapView)
Overlayreturn false). If you handled the Event, return true
, otherwise return false. If you returned true none of the following Overlays
or the underlying MapView has the chance to handle this event.onLongPress in class Overlaypublic boolean onTouchEvent(MotionEvent event,
MapView mapView)
Overlayreturn false). If you handled the Event, return true
, otherwise return false. If you returned true none of the following Overlays
or the underlying MapView has the chance to handle this event.onTouchEvent in class Overlayprotected boolean onMarkerClickDefault(Marker marker, MapView mapView)
public int getTextLabelBackgroundColor()
public void setTextLabelBackgroundColor(int mTextLabelBackgroundColor)
public int getTextLabelForegroundColor()
public void setTextLabelForegroundColor(int mTextLabelForegroundColor)
public int getTextLabelFontSize()
public void setTextLabelFontSize(int mTextLabelFontSize)