|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.osmdroid.views.overlay.Overlay
public abstract class Overlay
Base class representing an overlay which may be displayed on top of a MapView
. To add an
overlay, subclass this class, create an instance, and add it to the list obtained from
getOverlays() of MapView
.
This class implements a form of Gesture Handling similar to
GestureDetector.SimpleOnGestureListener
and
GestureDetector.OnGestureListener
. The difference is there is an additional argument for
the item.
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 ResourceProxy |
mResourceProxy
|
protected float |
mScale
|
protected static float |
SHADOW_X_SKEW
|
protected static float |
SHADOW_Y_SCALE
|
Fields inherited from interface org.osmdroid.views.util.constants.OverlayConstants |
---|
DEBUGMODE, DEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET |
Constructor Summary | |
---|---|
Overlay(android.content.Context ctx)
|
|
Overlay(ResourceProxy pResourceProxy)
|
Method Summary | |
---|---|
protected abstract void |
draw(android.graphics.Canvas c,
MapView osmv,
boolean shadow)
Draw the overlay over the map. |
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. x and y are pixel coordinates. |
protected static int |
getSafeMenuId()
Since the menu-chain will pass through several independent Overlays, menu IDs cannot be fixed at compile time. |
protected static int |
getSafeMenuIdSequence(int count)
Similar to |
boolean |
isEnabled()
Specifies if the Overlay is marked to be enabled. |
void |
onDetach(MapView mapView)
Override to perform clean up of resources before shutdown. |
boolean |
onDoubleTap(android.view.MotionEvent e,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onDoubleTapEvent(android.view.MotionEvent e,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onDown(android.view.MotionEvent e,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onFling(android.view.MotionEvent pEvent1,
android.view.MotionEvent pEvent2,
float pVelocityX,
float pVelocityY,
MapView pMapView)
By default does nothing ( return false ). |
boolean |
onKeyDown(int keyCode,
android.view.KeyEvent event,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onKeyUp(int keyCode,
android.view.KeyEvent event,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onLongPress(android.view.MotionEvent e,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onScroll(android.view.MotionEvent pEvent1,
android.view.MotionEvent pEvent2,
float pDistanceX,
float pDistanceY,
MapView pMapView)
By default does nothing ( return false ). |
void |
onShowPress(android.view.MotionEvent pEvent,
MapView pMapView)
|
boolean |
onSingleTapConfirmed(android.view.MotionEvent e,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onSingleTapUp(android.view.MotionEvent e,
MapView mapView)
By default does nothing ( return false ). |
boolean |
onTouchEvent(android.view.MotionEvent event,
MapView mapView)
You can prevent all(!) |
boolean |
onTrackballEvent(android.view.MotionEvent event,
MapView mapView)
By default does nothing ( return false ). |
void |
setEnabled(boolean pEnabled)
Sets whether the Overlay is marked to be enabled. |
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
protected final ResourceProxy mResourceProxy
protected final float mScale
Constructor Detail |
---|
public Overlay(android.content.Context ctx)
public Overlay(ResourceProxy pResourceProxy)
Method Detail |
---|
public void setEnabled(boolean pEnabled)
public boolean isEnabled()
protected static final int getSafeMenuId()
protected static final int getSafeMenuIdSequence(int count)
protected abstract void draw(android.graphics.Canvas c, MapView osmv, boolean shadow)
public void onDetach(MapView mapView)
public boolean onKeyDown(int keyCode, android.view.KeyEvent event, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onKeyUp(int keyCode, android.view.KeyEvent event, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onTouchEvent(android.view.MotionEvent event, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onTrackballEvent(android.view.MotionEvent event, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onDoubleTap(android.view.MotionEvent e, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onDoubleTapEvent(android.view.MotionEvent e, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onSingleTapConfirmed(android.view.MotionEvent e, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onDown(android.view.MotionEvent e, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onFling(android.view.MotionEvent pEvent1, android.view.MotionEvent pEvent2, float pVelocityX, float pVelocityY, MapView pMapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onLongPress(android.view.MotionEvent e, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public boolean onScroll(android.view.MotionEvent pEvent1, android.view.MotionEvent pEvent2, float pDistanceX, float pDistanceY, MapView pMapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
public void onShowPress(android.view.MotionEvent pEvent, MapView pMapView)
public boolean onSingleTapUp(android.view.MotionEvent e, MapView mapView)
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
protected static void drawAt(android.graphics.Canvas canvas, android.graphics.drawable.Drawable drawable, int x, int y, boolean shadow)
shadow
- If true, draw only the drawable's shadow. Otherwise, draw the drawable itself.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |