public class LineOverlay extends Overlay
LineOverlay是Overlay的一个实现类,它表示可以显示在地图上方的 线形 覆盖物图层。
Overlay.OverlayTapListener, Overlay.OverlayTouchEventListener, Overlay.OverlayTrackballEventListener
tapListener, touchListener, trackballListener
构造器和说明 |
---|
LineOverlay()
构造函数。
|
LineOverlay(Paint linePaint)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
void |
destroy()
销毁线覆盖物。
|
void |
draw(Canvas canvas, MapView mapView, boolean shadow)
绘制线覆盖物。
|
java.util.List<Point2D> |
getData()
返回组成线覆盖物的点数组
|
boolean |
isSelectedLine(MotionEvent event, Overlay overlay, MapView mapView)
选中点优先,即选中线而且选中端点时,相对于没有选中线即不触发选中线的点击增加节点事件,选中点返回false
|
boolean |
isSimplify()
是否简化。
|
boolean |
onTap(Point2D gp, MapView mapView)
判断是否发生点击事件。
|
boolean |
onTouchEvent(MotionEvent evt, MapView mapView)
判断是否发生触屏操作。
|
boolean |
onTrackballEvent(MotionEvent evt, MapView mapView)
判断是否存在跟踪球事件发生。
|
void |
setBoundingBox(BoundingBox boundingBox)
设置绘制线覆盖物的边界框。
|
void |
setData(java.util.List<Point2D> data)
设置组成线覆盖物的点数组。
|
void |
setData(java.util.List<Point2D> data, boolean recomputeBoundingBox)
设置组成线覆盖物的点数组,并设置是否据此重新计算边界框。
|
void |
setData(java.util.List<Point2D> data, BoundingBox bbox)
设置组成线覆盖物的点数组和边界框。
|
void |
setLinePaint(Paint paint)
设置线画笔。
|
void |
setPointPaint(Paint paint)
设置点画笔。
|
void |
setShowPoints(boolean showPoints)
设置是否显示线覆盖物上的节点
|
draw, drawAt, getKey, getZIndex, onKeyDown, onKeyUp, setKey, setTapListener, setTouchEventListener, setTrackballEventListener, setZIndex
public LineOverlay()
构造函数。
public LineOverlay(Paint linePaint)
构造函数。
linePaint
- 线画笔。public void setData(java.util.List<Point2D> data, BoundingBox bbox)
设置组成线覆盖物的点数组和边界框。
data
- 组成线覆盖物的点数组。bbox
- 边界框。public void setData(java.util.List<Point2D> data, boolean recomputeBoundingBox)
设置组成线覆盖物的点数组,并设置是否据此重新计算边界框。
data
- 组成线覆盖物的点数组。recomputeBoundingBox
- 是否重新计算边界框。public void setData(java.util.List<Point2D> data)
设置组成线覆盖物的点数组。
data
- 点数组。public java.util.List<Point2D> getData()
返回组成线覆盖物的点数组
public void setLinePaint(Paint paint)
设置线画笔。
paint
- 画笔。public void setShowPoints(boolean showPoints)
设置是否显示线覆盖物上的节点
showPoints
- 是否显示public void setPointPaint(Paint paint)
设置点画笔。
paint
- 画笔。public void setBoundingBox(BoundingBox boundingBox)
设置绘制线覆盖物的边界框。
boundingBox
- 线覆盖物的边界框。public boolean isSimplify()
是否简化。
public void draw(Canvas canvas, MapView mapView, boolean shadow)
绘制线覆盖物。
public boolean onTouchEvent(MotionEvent evt, MapView mapView)
判断是否发生触屏操作。
onTouchEvent
在类中 Overlay
evt
- 触屏操作对象。mapView
- 操作所在的地图视图。public boolean onTrackballEvent(MotionEvent evt, MapView mapView)
判断是否存在跟踪球事件发生。
onTrackballEvent
在类中 Overlay
evt
- 触屏操作对象。mapView
- 操作所在的地图视图。public boolean isSelectedLine(MotionEvent event, Overlay overlay, MapView mapView)
选中点优先,即选中线而且选中端点时,相对于没有选中线即不触发选中线的点击增加节点事件,选中点返回false
event
-overlay
-mapView
-