public class DrawableOverlay extends Overlay
DrawableOverlay是Overlay的一个实现类,它表示可以显示在地图上方的图片覆盖物图层。
Overlay.OverlayTapListener, Overlay.OverlayTouchEventListener, Overlay.OverlayTrackballEventListener
tapListener, touchListener, trackballListener
构造器和说明 |
---|
DrawableOverlay()
构造函数。
|
DrawableOverlay(Drawable drawable, BoundingBox bbox)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
void |
destroy()
销毁当前overlay。
|
void |
draw(Canvas canvas, MapView mapView, boolean shadow)
在地图mapView上方绘制覆盖物。
|
BoundingBox |
getBoundingBox()
返回覆盖物在地图上绘制的边界框。
|
Drawable |
getDrawable()
返回覆盖物的绘图对象。
|
boolean |
onTap(Point2D gp, MapView mapView)
判断是否发生点击事件。
|
boolean |
onTouchEvent(MotionEvent evt, MapView mapView)
判断是否发生触碰事件。
|
void |
setDrawable(Drawable drawable, BoundingBox bbox)
设置覆盖物的绘图对象和绘制边界框。
|
draw, drawAt, getKey, getZIndex, onKeyDown, onKeyUp, onTrackballEvent, setKey, setTapListener, setTouchEventListener, setTrackballEventListener, setZIndex
public DrawableOverlay()
构造函数。
public DrawableOverlay(Drawable drawable, BoundingBox bbox)
构造函数。
drawable
- 绘图对象。bbox
- 边界框。public void draw(Canvas canvas, MapView mapView, boolean shadow)
在地图mapView上方绘制覆盖物。
public void setDrawable(Drawable drawable, BoundingBox bbox)
设置覆盖物的绘图对象和绘制边界框。
drawable
- 绘图对象。bbox
- 边界框。public Drawable getDrawable()
返回覆盖物的绘图对象。
public BoundingBox getBoundingBox()
返回覆盖物在地图上绘制的边界框。
public boolean onTouchEvent(MotionEvent evt, MapView mapView)
判断是否发生触碰事件。
onTouchEvent
在类中 Overlay
evt
- 触屏操作对象。mapView
- 操作所在的地图视图。