public class Annotation extends Mark
Mark.setClickable(boolean)
: truesetSelected(boolean)
: falseMark.setHidden(boolean)
: falseMark.setTag(int)
: 0Annotation
能够以弹出方式显示的
Annotation
只能有一个,一旦有一个Annotation
被设置为弹出,那么之前弹出的
Annotation
将自动消失。限定符和类型 | 类和说明 |
---|---|
class |
Annotation.Area |
构造器和说明 |
---|
Annotation(int zLevel,
NdsPoint pos,
int iconId,
Vector2DF vpos)
创建
Annotation 实例 |
Annotation(int zLevel,
android.graphics.Point pos,
int iconId,
Vector2DF vpos)
创建
Annotation 实例 |
限定符和类型 | 方法和说明 |
---|---|
void |
freeNativeMemeory()
手动释放引擎中
Annotation 的实例内存 |
java.lang.String |
getIconText()
获取图标上的文字
|
int |
getZLevel()
获取压盖等级
|
int |
hitTest(android.graphics.Rect clickArea)
判断当前点击的区域
|
void |
setIcon(int iconId,
Vector2DF vpos)
设置显示图标
|
void |
setIconText(java.lang.String text,
int fillColor,
int edgeColor,
Vector2DF anchor)
设置图标上的文字
|
void |
setIconTextSize(int size)
设置图标文字大小
|
void |
setSelected(boolean selected)
设置当前
Annotation 是否为选中状态 |
void |
setZLevel(int zLevel)
设置Z轴方向的等级,在相同位置的Annotation,Z值大的会压盖Z值较小的
|
getCalloutStyle, getPosition, getPositionNds, getSubtitle, getTag, getTitle, isClickable, isHidden, isSelected, setCalloutStyle, setClickable, setHidden, setPosition, setPositionNds, setSubtitle, setTag, setTitle, showCallout
public Annotation(int zLevel, android.graphics.Point pos, int iconId, Vector2DF vpos)
Annotation
实例zLevel
- Z轴方向的等级,也就所处的压盖关系pos
- 所在位置,经纬度坐标iconId
- 所使用的图标ID。引擎默认的图标位于packet中,ID<1000,客户端自定义的图标应放在assets/navicore/res/
icons下面,且ID>=1000,可通过后缀"@m", "@h", "@xh"来适配不同设备。例如:1000.png,1000@m.png,1000@h.png,1000@xh.png。vpos
- 设置显示时调整的X轴,Y轴的偏移量public Annotation(int zLevel, NdsPoint pos, int iconId, Vector2DF vpos)
Annotation
实例zLevel
- Z轴方向的等级,也就所处的压盖关系pos
- 所在位置,Nds坐标iconId
- 所使用的图标IDvpos
- 设置显示时调整的X轴,Y轴的偏移量public void setIcon(int iconId, Vector2DF vpos)
iconId
- 显示时使用的图标IDvpos
- 显示时的相对图标中心的偏移量public void setZLevel(int zLevel)
zLevel
- Z轴方向的等级setSelected(boolean)
的
Annotation
绘制时总会画在最上面public int getZLevel()
public void setIconText(java.lang.String text, int fillColor, int edgeColor, Vector2DF anchor)
text
- 文字内容,最多9个字符fillColor
- 内容文字颜色edgeColor
- 描边颜色anchor
- 文字锚点位置,相对于图标左上角的偏移public java.lang.String getIconText()
public void setIconTextSize(int size)
size
- 文字大小public int hitTest(android.graphics.Rect clickArea)
clickArea
- 点击区域Annotation.Area
Annotation.Area
public void setSelected(boolean selected)
Annotation
是否为选中状态selected
- true为选中状态,false为非选中状态,会触发相应的
MapRenderer.Listener.onAnnotationSelected(Annotation)
和
MapRenderer.Listener.onAnnotationDeselected(Annotation)
回调Annotation
绘制时总会画在最上面,不管
setZLevel(int)
设置的值是多少public void freeNativeMemeory()
Annotation
的实例内存Annotation
没有添加到MapRenderer中时,需要手动释放©Mapbar Engine Team;All Rights Reserved