public final class Marker extends BasePointOverlay
一个marker有如下属性:
A marker has the following attributes:
Field1, Field2, overlayName| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy()
删除当前marker并销毁Marker的图片等资源。
|
boolean |
equals(java.lang.Object other) |
float |
getAlpha()
获取Marker覆盖物的透明度,透明度范围[0,1] 1为不透明,默认值为1
Get the transparency of the Marker overlay, transparency range [0,1] 1 is opaque, default value is 1 |
float |
getAltitude()
获取marker海拔
Get the altitude of the Marker. |
java.util.ArrayList<BitmapDescriptor> |
getIcons()
返回Marker动画帧的图标列表。
|
java.lang.String |
getId()
返回Marker 的Id,每个marker 的唯一标识,用来区分不同的Marker。
|
java.lang.Object |
getObject()
获取Marker覆盖物的附加信息对象,即自定义的Marker的属性。
|
MarkerOptions |
getOptions()
获取Marker覆盖物的选项类
Get the options class of the Marker overlay |
int |
getPeriod()
得到多少帧刷新一次图片资源。
|
LatLng |
getPosition()
获取 Marker 覆盖物的位置坐标。
|
float |
getRotateAngle()
获取 Marker覆盖物的图片旋转角度,从正北开始,逆时针计算。
|
java.lang.String |
getSnippet()
获取Marker 覆盖物的文字片段。
|
java.lang.String |
getTitle()
获取Marker 覆盖物的标题。
|
float |
getZIndex()
获取Marker覆盖物的z轴值。
|
int |
hashCode() |
void |
hideInfoWindow()
隐藏Marker覆盖物的信息窗口。
|
boolean |
isClickable()
获取Maker覆盖物的点击状态,可以通过
Marker.setClickable(boolean) 设置是否可以点击
Get the click status of the Maker overlay, can be set clickable via Marker.setClickable(boolean) |
boolean |
isDraggable()
获得Marker覆盖物的拖拽状态。
|
boolean |
isFlat()
返回Marker覆盖物是否是平贴在地图上。
|
boolean |
isIconView()
是否icon是view
|
boolean |
isInfoWindowEnable()
获取Marker覆盖物是否允许InfoWindow显示, 可以通过
Marker.setInfoWindowEnable(boolean) 进行设置
Get whether the Marker overlay allows InfoWindow to be displayed, can be set via Marker.setInfoWindowEnable(boolean) |
boolean |
isInfoWindowShown()
返回Marker覆盖物的信息窗口是否显示,true: 显示,false: 不显示。
|
boolean |
isPerspective()
已过时。
已取消这个效果
This effect has been canceled. |
boolean |
isRemoved()
获取当前Marker是否是被移除状态
Get whether the current Marker is in a removed state |
boolean |
isVisible()
返回Marker是否可见。
|
void |
remove()
删除当前marker。
|
void |
setAlpha(float alpha)
设置Marker覆盖物的透明度
Set the transparency of the Marker overlay |
void |
setAltitude(float altitude)
设置marker海拔
Set the altitude of the Marker. |
void |
setAnchor(float anchorU,
float anchorV)
设置Marker覆盖物的锚点比例。
|
void |
setAnimation(Animation animation)
设置动画,动画包含,旋转,缩放,消失,平移以及它们的组合动画
Sets the animation, which includes rotation, scaling, disappearance, translation, and their combined animations. |
void |
setClickable(boolean clickable)
设置Marker覆盖物是否可以点击
Set whether the Marker overlay is clickable |
void |
setDraggable(boolean paramBoolean)
设置Marker覆盖物是否允许拖拽。
|
void |
setFlat(boolean flat)
设置Marker覆盖物是否平贴在地图上。
|
void |
setIcon(BitmapDescriptor icon)
设置 Marker覆盖物的图标
Set the icon of the Marker overlay. |
void |
setIcons(java.util.ArrayList<BitmapDescriptor> icons)
设置 Marker 的图标集合,相同图案的 icon 的 marker 最好使用同一个 BitmapDescriptor 对象以节省内存空间。
|
void |
setInfoWindowEnable(boolean enabled)
设置Marker覆盖物的InfoWindow是否允许显示,默认为true
设置为false之后, 调用 Marker.showInfoWindow() 将不会生效
Set whether the InfoWindow of the Marker overlay is allowed to be displayed, default is true After setting to false, calling Marker.showInfoWindow() will not take effect |
void |
setMarkerOptions(MarkerOptions opt)
设置Marker覆盖物的属性选项类
通过markerOption 给marker设置属性
Set the property options class of the Marker overlay Set properties for the marker via markerOption |
void |
setObject(java.lang.Object object)
设置Marker覆盖物的附加信息对象。
|
void |
setPeriod(int period)
设置多少帧刷新一次图片资源,Marker动画的间隔时间,值越小动画越快。
|
void |
setPerspective(boolean isPerspective)
已过时。
已取消这个效果
This effect has been canceled. |
void |
setPosition(LatLng latlng)
设置 Marker 覆盖物的位置坐标。
|
void |
setPositionByPixels(int x,
int y)
设置marker覆盖物在屏幕的像素坐标。
|
void |
setRotateAngle(float rotate)
设置Marker覆盖物图片旋转的角度,从正北开始,逆时针计算。
|
void |
setSnippet(java.lang.String snippet)
设置Marker 覆盖物的文字片段。
|
void |
setTitle(java.lang.String title)
设置Marker 覆盖物的标题。
|
void |
setToTop()
设置当前marker在最上面。
|
void |
setVisible(boolean visible)
设置 Marker 覆盖物的可见属性。
|
void |
setZIndex(float zIndex)
设置Marker覆盖物的z轴值。
|
void |
showInfoWindow()
显示 Marker 覆盖物的信息窗口。
|
boolean |
startAnimation()
开始动画
Start animation |
setGeoPointmethod1, method2public void setPeriod(int period)
period - 刷新周期,越小速度越快。默认为20,最小为1。
public int getPeriod()
public void setIcons(java.util.ArrayList<BitmapDescriptor> icons)
icons - Marker动画帧的列表。
public java.util.ArrayList<BitmapDescriptor> getIcons()
public void remove()
remove 在类中 BasePointOverlaypublic void destroy()
destroy 在类中 BasePointOverlaypublic java.lang.String getId()
getId 在类中 BasePointOverlaypublic void setPerspective(boolean isPerspective)
isPerspective - true,设置近大远小效果;false,普通效果。
public boolean isPerspective()
public void setPosition(LatLng latlng)
若想让标记随地图移动,可以使用此方法改变。若想让 marker 在屏幕固定显示,可以使用 setPositionByPixels(int, int) 方法。
If you want the marker to move with the map, you can use this method to change it. If you want the marker to be displayed fixed on the screen, you can use the setPositionByPixels(int, int) method.
setPosition 在类中 BasePointOverlaylatlng - 位置坐标。
public LatLng getPosition()
getPosition 在类中 BasePointOverlaypublic void setTitle(java.lang.String title)
setTitle 在类中 BasePointOverlaytitle - 标题信息。
public java.lang.String getTitle()
getTitle 在类中 BasePointOverlaypublic void setSnippet(java.lang.String snippet)
setSnippet 在类中 BasePointOverlaysnippet - 文字片段。
public java.lang.String getSnippet()
getSnippet 在类中 BasePointOverlaypublic void setIcon(BitmapDescriptor icon)
icon - 图标public void setAnchor(float anchorU,
float anchorV)
anchorU - 锚点水平范围的比例。
anchorV - 锚点垂直范围的比例。
public void setDraggable(boolean paramBoolean)
paramBoolean - Marker是否可拖动,true表示可拖拽,false表示不可拖拽。
public boolean isDraggable()
public void showInfoWindow()
showInfoWindow 在类中 BasePointOverlaypublic void hideInfoWindow()
public boolean isInfoWindowShown()
public void setAltitude(float altitude)
altitude - public float getAltitude()
public void setVisible(boolean visible)
setVisible 在类中 BasePointOverlayvisible - 一个布尔值,表示Marker是否可见,true表示可见,false表示不可见。
public boolean isVisible()
isVisible 在类中 BasePointOverlaypublic boolean equals(java.lang.Object other)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic void setObject(java.lang.Object object)
setObject 在类中 BasePointOverlayobject - Marker覆盖物的附加信息对象
public java.lang.Object getObject()
getObject 在类中 BasePointOverlaypublic void setRotateAngle(float rotate)
setRotateAngle 在类中 BasePointOverlayrotate - Marker图片旋转的角度,从正北开始,逆时针计算。
public float getRotateAngle()
getRotateAngle 在类中 BasePointOverlaypublic void setToTop()
public void setFlat(boolean flat)
flat - Marker平贴地图设置为 true,面对镜头设置为 false。
public boolean isFlat()
public void setPositionByPixels(int x,
int y)
setPosition(LatLng) 改变。
setPosition(LatLng) to change it.x - 横向像素点。
y - 纵向像素点。
public void setZIndex(float zIndex)
zIndex - z轴,即竖直方向上的值
public float getZIndex()
public void setAnimation(Animation animation)
setAnimation 在类中 BasePointOverlayanimation - 动画类,详情请看 Animation
Animation for details.public boolean startAnimation()
startAnimation 在类中 BasePointOverlaypublic float getAlpha()
public void setAlpha(float alpha)
alpha - 透明度范围[0,1] 1为不透明
public MarkerOptions getOptions()
MarkerOptions
MarkerOptions for detailspublic boolean isClickable()
Marker.setClickable(boolean) 设置是否可以点击
Marker.setClickable(boolean)public boolean isInfoWindowEnable()
Marker.setInfoWindowEnable(boolean) 进行设置
Marker.setInfoWindowEnable(boolean)isInfoWindowEnable 在类中 BasePointOverlaypublic void setInfoWindowEnable(boolean enabled)
Marker.showInfoWindow() 将不会生效
Marker.showInfoWindow() will not take effectenabled - true:允许显示,false:不允许显示
public void setMarkerOptions(MarkerOptions opt)
opt - 一个MarkerOptions 对象,它定义了如何渲染Marker 的属性。
public void setClickable(boolean clickable)
clickable - true : 表示可以点击,false:表示不可点击
public boolean isRemoved()
public boolean isIconView()