public class MapViewPosition extends Observable implements IMapViewPosition, Persistable
| Constructor and Description |
|---|
MapViewPosition(DisplayModel displayModel) |
| Modifier and Type | Method and Description |
|---|---|
void |
animateTo(org.mapsforge.core.model.LatLong latLong)
Animate the map towards the given position.
|
boolean |
animationInProgress() |
void |
destroy()
Destroys the class.
|
org.mapsforge.core.model.LatLong |
getCenter()
Returns the current center position of the map.
|
org.mapsforge.core.model.BoundingBox |
getMapLimit() |
org.mapsforge.core.model.MapPosition |
getMapPosition()
Returns a newly instantiated object representing the current position and zoomlevel.
|
org.mapsforge.core.model.LatLong |
getPivot()
The pivot point is the point the map zooms around.
|
org.mapsforge.core.model.Point |
getPivotXY(byte zoomLevel)
The pivot point is the point the map zooms around.
|
double |
getScaleFactor()
Gets the current scale factor.
|
byte |
getZoomLevel() |
byte |
getZoomLevelMax() |
byte |
getZoomLevelMin() |
void |
init(PreferencesFacade preferencesFacade)
Initializes the class.
|
void |
moveCenter(double moveHorizontal,
double moveVertical)
Animates the center position of the map by the given amount of pixels.
|
void |
moveCenter(double moveHorizontal,
double moveVertical,
boolean animated)
Moves the center position of the map by the given amount of pixels.
|
void |
moveCenterAndZoom(double moveHorizontal,
double moveVertical,
byte zoomLevelDiff)
Animates the center position of the map by the given amount of pixels.
|
void |
moveCenterAndZoom(double moveHorizontal,
double moveVertical,
byte zoomLevelDiff,
boolean animated)
Moves the center position of the map by the given amount of pixels.
|
void |
save(PreferencesFacade preferencesFacade)
Saves the current state.
|
void |
setCenter(org.mapsforge.core.model.LatLong latLong)
Sets the new center position of the map.
|
void |
setMapLimit(org.mapsforge.core.model.BoundingBox mapLimit)
Sets the new limit of the map (might be null).
|
void |
setMapPosition(org.mapsforge.core.model.MapPosition mapPosition)
Sets the new center position and zoom level of the map.
|
void |
setMapPosition(org.mapsforge.core.model.MapPosition mapPosition,
boolean animated)
Sets the new center position and zoom level of the map.
|
void |
setPivot(org.mapsforge.core.model.LatLong pivot)
The pivot point is the point the map is scaled around when zooming.
|
void |
setScaleFactor(double scaleFactor)
Sets the new scale factor to be applied.
|
void |
setScaleFactorAdjustment(double adjustment) |
void |
setZoomLevel(byte zoomLevel)
Sets the new zoom level of the map.
|
void |
setZoomLevel(byte zoomLevel,
boolean animated)
Sets the new zoom level of the map
|
void |
setZoomLevelMax(byte zoomLevelMax) |
void |
setZoomLevelMin(byte zoomLevelMin) |
void |
zoom(byte zoomLevelDiff)
Changes the current zoom level by the given value if possible.
|
void |
zoom(byte zoomLevelDiff,
boolean animated)
Changes the current zoom level by the given value if possible.
|
void |
zoomIn()
Increases the current zoom level by one if possible.
|
void |
zoomIn(boolean animated)
Increases the current zoom level by one if possible.
|
void |
zoomOut()
Decreases the current zoom level by one if possible.
|
void |
zoomOut(boolean animated)
Decreases the current zoom level by one if possible.
|
addObserver, notifyObservers, removeObserverclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddObserver, removeObserverpublic MapViewPosition(DisplayModel displayModel)
public void animateTo(org.mapsforge.core.model.LatLong latLong)
animateTo in interface IMapViewPositionpublic boolean animationInProgress()
animationInProgress in interface IMapViewPositionpublic void destroy()
IMapViewPositiondestroy in interface IMapViewPositionpublic org.mapsforge.core.model.LatLong getCenter()
IMapViewPositiongetCenter in interface IMapViewPositionpublic org.mapsforge.core.model.BoundingBox getMapLimit()
getMapLimit in interface IMapViewPositionpublic org.mapsforge.core.model.MapPosition getMapPosition()
IMapViewPositiongetMapPosition in interface IMapViewPositionpublic org.mapsforge.core.model.LatLong getPivot()
getPivot in interface IMapViewPositionpublic org.mapsforge.core.model.Point getPivotXY(byte zoomLevel)
zoomLevel - the zoomlevel to compute the x/y coordinates forpublic double getScaleFactor()
IMapViewPositionNeeded by mapsforge core classes.
getScaleFactor in interface IMapViewPositionpublic byte getZoomLevel()
getZoomLevel in interface IMapViewPositionpublic byte getZoomLevelMax()
getZoomLevelMax in interface IMapViewPositionpublic byte getZoomLevelMin()
getZoomLevelMin in interface IMapViewPositionpublic void init(PreferencesFacade preferencesFacade)
IMapViewPositionNeeded by mapsforge core classes.
init in interface Persistableinit in interface IMapViewPositionpublic void moveCenter(double moveHorizontal,
double moveVertical)
moveCenter in interface IMapViewPositionmoveHorizontal - the amount of pixels to move this MapViewPosition horizontally.moveVertical - the amount of pixels to move this MapViewPosition vertically.public void moveCenter(double moveHorizontal,
double moveVertical,
boolean animated)
moveCenter in interface IMapViewPositionmoveHorizontal - the amount of pixels to move this MapViewPosition horizontally.moveVertical - the amount of pixels to move this MapViewPosition vertically.animated - whether the move should be animated.public void moveCenterAndZoom(double moveHorizontal,
double moveVertical,
byte zoomLevelDiff)
moveCenterAndZoom in interface IMapViewPositionmoveHorizontal - the amount of pixels to move this MapViewPosition horizontally.moveVertical - the amount of pixels to move this MapViewPosition vertically.zoomLevelDiff - the difference in desired zoom level.public void moveCenterAndZoom(double moveHorizontal,
double moveVertical,
byte zoomLevelDiff,
boolean animated)
moveHorizontal - the amount of pixels to move this MapViewPosition horizontally.moveVertical - the amount of pixels to move this MapViewPosition vertically.zoomLevelDiff - the difference in desired zoom level.animated - whether the move should be animated.public void save(PreferencesFacade preferencesFacade)
IMapViewPositionNeeded by mapsforge core classes.
save in interface Persistablesave in interface IMapViewPositionpublic void setCenter(org.mapsforge.core.model.LatLong latLong)
setCenter in interface IMapViewPositionpublic void setMapLimit(org.mapsforge.core.model.BoundingBox mapLimit)
setMapLimit in interface IMapViewPositionpublic void setMapPosition(org.mapsforge.core.model.MapPosition mapPosition)
setMapPosition in interface IMapViewPositionpublic void setMapPosition(org.mapsforge.core.model.MapPosition mapPosition,
boolean animated)
setMapPosition in interface IMapViewPositionpublic void setPivot(org.mapsforge.core.model.LatLong pivot)
setPivot in interface IMapViewPositionpivot - lat/long of pivot point, null for map centerpublic void setScaleFactor(double scaleFactor)
public void setScaleFactorAdjustment(double adjustment)
setScaleFactorAdjustment in interface IMapViewPositionpublic void setZoomLevel(byte zoomLevel)
setZoomLevel in interface IMapViewPositionzoomLevel - new zoom level.java.lang.IllegalArgumentException - if the zoom level is negative.public void setZoomLevel(byte zoomLevel,
boolean animated)
setZoomLevel in interface IMapViewPositionzoomLevel - desired zoom levelanimated - true if the transition should be animated, false otherwisejava.lang.IllegalArgumentException - if the zoom level is negative.public void setZoomLevelMax(byte zoomLevelMax)
setZoomLevelMax in interface IMapViewPositionpublic void setZoomLevelMin(byte zoomLevelMin)
setZoomLevelMin in interface IMapViewPositionpublic void zoom(byte zoomLevelDiff)
zoom in interface IMapViewPositionpublic void zoom(byte zoomLevelDiff,
boolean animated)
public void zoomIn()
zoomIn in interface IMapViewPositionpublic void zoomIn(boolean animated)
public void zoomOut()
zoomOut in interface IMapViewPositionpublic void zoomOut(boolean animated)