|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.android.maps.MapController
public final class MapController
A utility class to manage panning and zooming of a map.
Method Summary | |
---|---|
void |
animateTo(GeoPoint point)
Start animating the map towards the given point. |
void |
animateTo(GeoPoint point,
android.os.Message message)
Start animating the map towards the given point. |
void |
animateTo(GeoPoint point,
java.lang.Runnable runnable)
Start animating the map towards the given point. |
boolean |
onKey(android.view.View v,
int keyCode,
android.view.KeyEvent event)
Processes key events and translates them into appropriate panning of the map. |
void |
scrollBy(int x,
int y)
Scroll by a given amount, in pixels. |
void |
setCenter(GeoPoint point)
Set the map view to the given center. |
int |
setZoom(int zoomLevel)
Sets the zoomlevel of the map. |
void |
stopAnimation(boolean jumpToFinish)
Stops any animation that may be in progress, and conditionally update the map center to whatever offset the partial animation had achieved. |
void |
stopPanning()
Resets the pan state to make the map stationary. |
boolean |
zoomIn()
Zoom in by one zoom level. |
boolean |
zoomInFixing(int xPixel,
int yPixel)
Zoom in by one zoom level. |
boolean |
zoomOut()
Zoom out by one zoom level. |
boolean |
zoomOutFixing(int xPixel,
int yPixel)
Zoom out by one zoom level. |
void |
zoomToSpan(int latSpanE6,
int lonSpanE6)
Attempts to adjust the zoom of the map so that the given span of latitude and longitude will be displayed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void stopPanning()
public boolean onKey(android.view.View v, int keyCode, android.view.KeyEvent event)
View.OnKeyListener
.
onKey
in interface android.view.View.OnKeyListener
public void animateTo(GeoPoint point)
public void animateTo(GeoPoint point, android.os.Message message)
public void animateTo(GeoPoint point, java.lang.Runnable runnable)
point
- Where to animate the map towards.runnable
- If and when the animation reaches its natural
conclusion, this callback will be run on the UI thread. The
callback will not be run if the animation is aborted.public void scrollBy(int x, int y)
x
- the horizontal scroll amount in pixels.y
- the vertical scroll amount in pixels.public void setCenter(GeoPoint point)
public void stopAnimation(boolean jumpToFinish)
jumpToFinish
- if true, we'll shortcut the animation to its endpoint.
if false, we'll cut it off where it stands.public int setZoom(int zoomLevel)
zoomIn()
or zoomOut()
.
zoomLevel
- At zoomLevel 1, the equator of the earth is
256 pixels long. Each successive zoom level is magnified by a
factor of 2.
public void zoomToSpan(int latSpanE6, int lonSpanE6)
public boolean zoomIn()
MapView.getZoomControls()
), then this will also call through to
MapView.displayZoomControls(boolean)
causing the ZoomControls to
appear briefly, but they will not take focus.
public boolean zoomOut()
MapView.getZoomControls()
), then this will also call through to
MapView.displayZoomControls(boolean)
causing the ZoomControls to
appear briefly, but they will not take focus.
public boolean zoomInFixing(int xPixel, int yPixel)
MapView.getZoomControls()
), then this will also call through to
MapView.displayZoomControls(boolean)
causing the ZoomControls to
appear briefly, but they will not take focus. This zoom will also pan the map to keep a single point fixed on the screen. Specify the point you want fixed by giving its pixel coordinates.
xPixel
- offset, in pixels from the left of the map,
where the fixed point of our zoom will be.yPixel
- offset, in pixels from the top of the map,
where the fixed point of our zoom will be.
public boolean zoomOutFixing(int xPixel, int yPixel)
MapView.getZoomControls()
), then this will also call through to
MapView.displayZoomControls(boolean)
causing the ZoomControls to
appear briefly, but they will not take focus.This zoom will also pan the map to keep a single point fixed on the screen. Specify the point you want fixed by giving its pixel coordinates.
xPixel
- offset, in pixels from the left of the map,
where the fixed point of our zoom will be.yPixel
- offset, in pixels from the top of the map,
where the fixed point of our zoom will be.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |