|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.android.maps.Overlay
public abstract class Overlay
Base class representing an overlay which may be displayed on top of a map. To
add an overlay, subclass this class, create an instance, and add it to the
list obtained from MapView.getOverlays()
.
In order to allow a user's touch to snap to a point, the subclass should
implement the Overlay.Snappable
interface.
Nested Class Summary | |
---|---|
static interface |
Overlay.Snappable
Interface definition for overlays that contain items that can be snapped to (for example, when the user invokes a zoom, this could be called allowing the user to snap the zoom to an interesting point.) |
Field Summary | |
---|---|
protected static float |
SHADOW_X_SKEW
X Skew value for creating a marker shadow in perspective. |
protected static float |
SHADOW_Y_SCALE
Y Scale value for creating a marker shadow in perspective. |
Constructor Summary | |
---|---|
Overlay()
|
Method Summary | |
---|---|
void |
draw(android.graphics.Canvas canvas,
MapView mapView,
boolean shadow)
Draw the overlay over the map. |
boolean |
draw(android.graphics.Canvas canvas,
MapView mapView,
boolean shadow,
long when)
Draw call for animated overlays. |
protected static void |
drawAt(android.graphics.Canvas canvas,
android.graphics.drawable.Drawable drawable,
int x,
int y,
boolean shadow)
Convenience method to draw a Drawable at an offset. |
boolean |
onKeyDown(int keyCode,
android.view.KeyEvent event,
MapView mapView)
Handle a key down event. |
boolean |
onKeyUp(int keyCode,
android.view.KeyEvent event,
MapView mapView)
Handle a key up event. |
boolean |
onTap(GeoPoint p,
MapView mapView)
Handle a "tap" event. |
boolean |
onTouchEvent(android.view.MotionEvent e,
MapView mapView)
Handle a touch event. |
boolean |
onTrackballEvent(android.view.MotionEvent event,
MapView mapView)
Handle a trackball event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final float SHADOW_X_SKEW
protected static final float SHADOW_Y_SCALE
Constructor Detail |
---|
public Overlay()
Method Detail |
---|
protected static void drawAt(android.graphics.Canvas canvas, android.graphics.drawable.Drawable drawable, int x, int y, boolean shadow)
MapView.getProjection()
method on the MapView
passed to you in draw(Canvas, MapView, boolean)
.
shadow
- If true, draw only the drawable's shadow. Otherwise,
draw the drawable itself.public boolean onTouchEvent(android.view.MotionEvent e, MapView mapView)
e
- The motion event.mapView
- the MapView that generated the touch event
public boolean onTrackballEvent(android.view.MotionEvent event, MapView mapView)
event
- The motion event.mapView
- the MapView that generated the trackball event
public boolean onKeyDown(int keyCode, android.view.KeyEvent event, MapView mapView)
keyCode
- The key code.event
- The key event.mapView
- the MapView that generated the key event
public boolean onKeyUp(int keyCode, android.view.KeyEvent event, MapView mapView)
keyCode
- The key codeevent
- The key eventmapView
- the MapView that generated the key event
public boolean onTap(GeoPoint p, MapView mapView)
p
- The point that has been tapped.mapView
- the MapView that generated the tap event
public void draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow)
canvas
- The Canvas upon which to draw. Note that this
may already have a transformation applied, so be sure to leave
it the way you found it.mapView
- the MapView that requested the draw. Use MapView.getProjection()
to convert between on-screen pixels and
latitude/longitude pairs.shadow
- If true, draw the shadow layer. If false, draw the
overlay contents.public boolean draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow, long when)
draw(Canvas, MapView, boolean)
and returns false.
canvas
- The Canvas upon which to draw. Note that this
may already have a transformation applied, so be sure to leave
it the way you found it.mapView
- the MapView that requested the draw. Use MapView.getProjection()
to convert between on-screen pixels and
latitude/longitude pairs.shadow
- If true, draw the shadow layer. If false, draw the
overlay contents.when
- The timestamp of the draw.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |