public class NavigateArrow extends BaseOverlay
箭头是由两个顶点之间连贯的点构成的。如果两个顶点相同,则一个箭头将闭合。
宽度是单位是像素。宽度是可视区域的缩放级别无关。默认为10。
箭头的顶颜色是ARGB格式,颜色格式可以参考android.graphics.Color。默认是黑色。
箭头的侧边颜色是ARGB格式,颜色格式可以参考android.graphics.Color。默认是黑色。
Z轴是控制地图覆盖物(overlay)之间的绘制层次的参数。这个参数能够控制Circles、Polygons、Polyline的绘制层次,但不会影响marker。Z轴数值越大的覆盖物(overlay)将会绘制在更上层。如果两个及两个以上覆盖物(overlay)的Z轴数值相同,则最后的绘制结果是随机的。覆盖物(overlay)的默认为Z轴为0。
这个属性表示了箭头是否可以显示在地图上。如果设置为不可见,则绘制地图时不会绘制此箭头,但其他属性不受影响。默认为可见。
箭头属性的修改必须在主线程里调用,否则将会抛出IllegalStateException。
The arrow is formed by connected points between two vertices. If the two vertices are the same, the arrow will be closed.
The width is in pixels. The width is independent of the zoom level of the visible area. The default is 10.
The top color of the arrow is in ARGB format, and the color format can refer to android.graphics.Color. The default is black.
The side color of the arrow is in ARGB format, and the color format can refer to android.graphics.Color. The default is black.
The Z-axis is a parameter that controls the drawing hierarchy between map overlays. This parameter can control the drawing hierarchy of Circles, Polygons, and Polylines, but it will not affect markers. Overlays with larger Z-axis values will be drawn on top. If two or more overlays have the same Z-axis value, the final drawing result is random. The default Z-axis for overlays is 0.
This attribute indicates whether the arrow can be displayed on the map. If set to invisible, the arrow will not be drawn when the map is drawn, but other attributes will not be affected. The default is visible.
Modifications to the arrow's attributes must be called in the main thread, otherwise an IllegalStateException will be thrown.
Field1, Field2, overlayName| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getId()
获取箭头(NavigateArrow)覆盖物的Id。
|
java.util.List<LatLng> |
getPoints()
获取箭头(NavigateArrow)覆盖物的顶点列表。
|
int |
getSideColor()
已过时。
|
int |
getTopColor()
获取(NavigateArrow)覆盖物的顶颜色。
|
float |
getWidth()
返回箭头(NavigateArrow)覆盖物的宽度值
Return the width value of the arrow (NavigateArrow) overlay. |
float |
getZIndex()
获取箭头(NavigateArrow)覆盖物的z轴值。
|
int |
hashCode() |
boolean |
is3DModel()
获取箭头(NavigateArrow)覆盖物是否是3D模式
Get whether the arrow (NavigateArrow) overlay is in 3D mode. |
boolean |
isVisible()
获取箭头(NavigateArrow)覆盖物是否可见。
|
void |
remove()
从地图上删除当前箭头(NavigateArrow)覆盖物。
|
void |
set3DModel(boolean enable)
设置箭头(NavigateArrow)覆盖物的是否为3D模式。
|
void |
setPoints(java.util.List<LatLng> points)
设置箭头(NavigateArrow)覆盖物的顶点坐标。
|
void |
setSideColor(int color)
设置箭头(NavigateArrow)覆盖物的侧边颜色。
|
void |
setTopColor(int color)
设置箭头(NavigateArrow)覆盖物的顶部颜色
Set the top color of the arrow (NavigateArrow) overlay. |
void |
setVisible(boolean visible)
设置箭头(NavigateArrow)覆盖物的是否可见。
|
void |
setWidth(float width)
设置箭头(NavigateArrow)覆盖物的宽度
Set the width of the arrow (NavigateArrow) overlay. |
void |
setZIndex(float zIndex)
设置箭头(NavigateArrow)覆盖物Z轴的值。
|
method1, method2public void remove()
public java.lang.String getId()
public void setPoints(java.util.List<LatLng> points)
points - 箭头顶点坐标集合。
public java.util.List<LatLng> getPoints()
public void setWidth(float width)
width - (NavigateArrow)覆盖物宽度 单位:像素
public float getWidth()
public void setTopColor(int color)
color - 颜色的ARGB格式
public int getTopColor()
public void setSideColor(int color)
color - 侧边颜色,ARGB格式。
@Deprecated public int getSideColor()
public void setZIndex(float zIndex)
zIndex - Z轴的值。
public float getZIndex()
public void setVisible(boolean visible)
visible - true:可见,false:不可见。
public boolean isVisible()
public void set3DModel(boolean enable)
NavigateArrow.setSideColor(int) 的值也会生效
NavigateArrow.setSideColor(int) will also take effect.enable - 一个表示箭头是为3D模式的布尔值,true表示3D,false表示不是3D即2D。
public boolean is3DModel()
public boolean equals(java.lang.Object other)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Object