public class Marker extends OverlayWithIW
限定符和类型 | 类和说明 |
---|---|
static interface |
Marker.OnMarkerClickListener
marker点击监听者接口
|
static interface |
Marker.OnMarkerDragListener
marker拖曳监听者接口
|
Overlay.Snappable
限定符和类型 | 字段和说明 |
---|---|
static float |
ANCHOR_BOTTOM
图标图像(U,V)坐标系统中的常用值
|
static float |
ANCHOR_CENTER
图标图像(U,V)坐标系统中的常用值
|
static float |
ANCHOR_LEFT
图标图像(U,V)坐标系统中的常用值
|
static float |
ANCHOR_RIGHT
图标图像(U,V)坐标系统中的常用值
|
static float |
ANCHOR_TOP
图标图像(U,V)坐标系统中的常用值
|
static boolean |
ENABLE_TEXT_LABELS_WHEN_NO_IMAGE
这是一个选择的功能,用于解析KML.如果没有图像的网址的情况下设置一个KML标记文本图像的图标标签.它也在一些其他情况下使用,
如在地图上放置一个通用文本标签
|
DEBUGMODE, DEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET
限定符和类型 | 方法和说明 |
---|---|
static void |
cleanDefaults()
清除marker的默认图标,默认infowindow.
|
void |
draw(Canvas canvas,
MapView mapView,
boolean shadow)
绘制在地图上的覆盖物,
|
float |
getAlpha()
获得marker透明度
|
Drawable |
getImage()
获得infowindow上的图标
|
GeoPoint |
getPosition()
获得位置坐标点信息
|
float |
getRotation()
获得marker方位
|
int |
getTextLabelBackgroundColor()
文本标签背景颜色值
|
int |
getTextLabelFontSize()
获得文本标签文字大小
|
int |
getTextLabelForegroundColor()
文本标签前景色颜色值
|
boolean |
hitTest(MotionEvent event,
MapView mapView) |
boolean |
isDraggable()
获得marker是否拖曳
|
boolean |
isFlat() |
boolean |
isInfoWindowShown()
获取infowindow是否在显示
|
void |
moveToEventPosition(MotionEvent event,
MapView mapView)
移动到事件位置
|
void |
onDetach(MapView mapView)
关闭之前清理所有的资源, 默认不做任何事情
|
boolean |
onLongPress(MotionEvent event,
MapView mapView)
默认不做任何事情,你可以使用此方法阻断所有的触摸事件,return TRUE,ELse return FALSE;在返回true时,并且点击地图位置无覆盖物,则有机会去
处理该事件
|
boolean |
onSingleTapConfirmed(MotionEvent event,
MapView mapView)
默认不做任何事情,你可以使用此方法阻断所有的触摸事件,return TRUE,ELse return FALSE;在返回true时,并且点击地图位置无覆盖物,则有机会去
处理该单机确认事件
|
boolean |
onTouchEvent(MotionEvent event,
MapView mapView)
默认不做任何事情,你可以使用此方法阻断所有的触摸事件,return TRUE,ELse return FALSE;在返回true时,并且点击地图位置无覆盖物,则有机会去
处理该触摸事件
|
void |
remove(MapView mapView)
移除所有marker
|
void |
setAlpha(float alpha)
设置marker透明度
|
void |
setAnchor(float anchorU,
float anchorV) |
void |
setDraggable(boolean draggable)
设置marker是否可以拖曳
|
void |
setFlat(boolean flat) |
void |
setIcon(Drawable icon)
为marker设置图标,可以随时改变.
|
void |
setImage(Drawable image)
设置显示在infowindow上的图标
|
void |
setInfoWindow(MarkerInfoWindow infoWindow)
用于设置窗口.默认的是markerinfowindow,与 布局命名为"bonuspack_bubble".您可以使用此方法来使用
自己的布局,或使用自己的子类窗口.请注意,这个窗口将接收到的标记的对象作为输入,因此必须 能够处理标记属性.如果你不想要任何信息窗口
打开,您可以将其设置为空.
|
void |
setInfoWindowAnchor(float anchorU,
float anchorV) |
void |
setOnMarkerClickListener(Marker.OnMarkerClickListener listener)
设置marker点击监听事件
|
void |
setOnMarkerDragListener(Marker.OnMarkerDragListener listener)
设置marker拖曳监听事件
|
void |
setPanToView(boolean panToView)
如果设置为true,当点击marker,将在 标记的中心位置弹出infowindow.默认是true.
|
void |
setPosition(GeoPoint position)
设置位置坐标点信息
|
void |
setRotation(float rotation)
设置marker方位
|
void |
setTextLabelBackgroundColor(int mTextLabelBackgroundColor)
设置文本标签背景颜色值
|
void |
setTextLabelFontSize(int mTextLabelFontSize)
设置文本标签文字大小
|
void |
setTextLabelForegroundColor(int mTextLabelForegroundColor)
设置文本标签前景色颜色值
|
void |
showInfoWindow()
点击marker显示infowindow.
|
closeInfoWindow, getInfoWindow, getRelatedObject, getSnippet, getSubDescription, getTitle, isInfoWindowOpen, setInfoWindow, setRelatedObject, setSnippet, setSubDescription, setTitle
isEnabled, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onScroll, onShowPress, onSingleTapUp, onTrackballEvent, setEnabled
public static boolean ENABLE_TEXT_LABELS_WHEN_NO_IMAGE
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)
mapView
- MapView对象public Marker(MapView mapView, Context resourceProxy)
mapView
- MapView对象resourceProxy
- 上下文public void setIcon(Drawable icon)
icon
- 图标.如果为null,为marker设置一个默认的.public GeoPoint getPosition()
public void setPosition(GeoPoint position)
position
- 位置坐标点信息public float getRotation()
public void setRotation(float rotation)
rotation
- marker方位public void setAnchor(float anchorU, float anchorV)
public void setInfoWindowAnchor(float anchorU, float anchorV)
public void setAlpha(float alpha)
alpha
- 透明度public float getAlpha()
public void setDraggable(boolean draggable)
draggable
- 是否可以拖曳public boolean isDraggable()
public void setFlat(boolean flat)
public boolean isFlat()
public void remove(MapView mapView)
mapView
- MapView对象public void setOnMarkerClickListener(Marker.OnMarkerClickListener listener)
listener
- marker点击监听者public void setOnMarkerDragListener(Marker.OnMarkerDragListener listener)
listener
- marker拖曳监听者public void setImage(Drawable image)
image
- 显示在infowindow上的图标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)
Overlay
canvas
- CanvasmapView
- 大地图mapViewshadow
- 是否执行public static void cleanDefaults()
public boolean hitTest(MotionEvent event, MapView mapView)
public boolean onSingleTapConfirmed(MotionEvent event, MapView mapView)
Overlay
onSingleTapConfirmed
在类中 Overlay
public void moveToEventPosition(MotionEvent event, MapView mapView)
event
- 触摸对象mapView
- MapView对象public boolean onLongPress(MotionEvent event, MapView mapView)
Overlay
onLongPress
在类中 Overlay
public boolean onTouchEvent(MotionEvent event, MapView mapView)
Overlay
onTouchEvent
在类中 Overlay
public int getTextLabelBackgroundColor()
public void setTextLabelBackgroundColor(int mTextLabelBackgroundColor)
mTextLabelBackgroundColor
- 颜色值public int getTextLabelForegroundColor()
public void setTextLabelForegroundColor(int mTextLabelForegroundColor)
mTextLabelForegroundColor
- 颜色值public int getTextLabelFontSize()
public void setTextLabelFontSize(int mTextLabelFontSize)
mTextLabelFontSize
- 字体大小