com.google.android.maps.Overlay
Base class representing an overlay which may be displayed on top of
a map. To add an overlay, create an implemention of this class and
then pass it to add(Overlay, boolean) on the controller obtained
from createOverlayController().
Nested Classes
Known Direct Subclasses
Summary
Constants
| |
|
|
Value |
|
| float |
SHADOW_X_SKEW |
X Skew value for creating a marker shadow in perspective. |
-0.9 |
| float |
SHADOW_Y_SCALE |
Y Scale value for creating a marker shadow in perspective. |
0.5 |
| int[] |
sXYCoords |
Coordinate pair for temporary use. |
|
|
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
protected
static
final
float
SHADOW_X_SKEW
X Skew value for creating a marker shadow in perspective.
Constant Value:
-0.9
protected
static
final
float
SHADOW_Y_SCALE
Y Scale value for creating a marker shadow in perspective.
Constant Value:
0.5
protected
static
final
int[]
sXYCoords
Coordinate pair for temporary use.
Public Constructors
Public Methods
public
boolean
draw(Canvas canvas, PixelCalculator calculator, boolean shadow, long when)
Draw call for animated overlays. By default, calls through to
draw(Canvas, PixelCalculator, boolean) and returns false.
Parameters
| when
| the timestamp of the draw |
Returns
- true if you need to be drawn again right away; false
otherwise. Default implementation returns false.
public
void
draw(Canvas canvas, PixelCalculator calculator, boolean shadow)
Draw the overlay over the map. This will be called on all
active overlays with shadow=true, to lay down the shadow layer,
and then again on all overlays with shadow=false.
By default, draws nothing.
public
Point
getCenter()
The overlay may suggest a new map center when it is loaded by overriding
this method and returning a non-null Point.
public
int
getLatSpanE6()
Returns
- a suggested latidunial map-span for optimal viewing of
the overlay. By default, returns -1 to decline to request a span.
public
int
getLonSpanE6()
Returns
- a suggested longitudinal map-span for optimal viewing of
the overlay. By default, returns -1 to decline to request a span.
public
String
getTitle()
If the overlay has a title, it can override this method to be listed
in the overlay-switcher menu.
public
final
boolean
isActive()
public
void
onDeactivate()
This will be called before the overlay is deactivated or removed.
Handle a tap event.
By default does nothing and returns false.
Parameters
| deviceType
| the type of the device that generated the tap |
| p
| the point that has been tapped |
| calculator
| maps lat/lon to screen coordinates. |
Returns
- true if the tap was handled by this overlay.
Protected Methods
protected
static
void
drawAt(Canvas canvas, Drawable drawable, int x, int y, boolean shadow)
Convenience method to draw a Drawable at an offset. x and y
are pixel coordinates. You can find appropriate coordinates
from latitude/longitude using the
object in {@link #draw to call
getPointXY(Point, int[]).
Parameters
| shadow
| if true, draw only the drawable's shadow. Otherwise,
draw the drawable itself.
|