public class MapViewPosition extends Observable implements Persistable
| Constructor and Description |
|---|
MapViewPosition(DisplayModel displayModel) |
| Modifier and Type | Method and Description |
|---|---|
void |
animateTo(LatLong pos)
Start animating the map towards the given point.
|
boolean |
animationInProgress() |
void |
destroy() |
LatLong |
getCenter() |
BoundingBox |
getMapLimit() |
MapPosition |
getMapPosition() |
LatLong |
getPivot()
The pivot point is the point the map zooms around.
|
Point |
getPivotXY(byte zoomLevel)
The pivot point is the point the map zooms around.
|
double |
getScaleFactor() |
byte |
getZoomLevel() |
byte |
getZoomLevelMax() |
byte |
getZoomLevelMin() |
void |
init(PreferencesFacade preferencesFacade) |
void |
moveCenter(double moveHorizontal,
double moveVertical)
Moves the center position of the map by the given amount of pixels.
|
void |
moveCenterAndZoom(double moveHorizontal,
double moveVertical,
byte zoomLevelDiff)
Moves the center position of the map by the given amount of pixels.
|
void |
save(PreferencesFacade preferencesFacade) |
void |
setCenter(LatLong latLong)
Sets the new center position of the map.
|
void |
setMapLimit(BoundingBox mapLimit)
Sets the new limit of the map (might be null).
|
void |
setMapPosition(MapPosition mapPosition)
Sets the new center position and zoom level of the map.
|
void |
setPivot(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 |
setZoomLevelMax(byte zoomLevelMax) |
void |
setZoomLevelMin(byte zoomLevelMin) |
void |
zoom(byte zoomLevelDiff)
Changes the current zoom level by the given value if possible.
|
void |
zoomIn()
Increases the current zoom level by one if possible.
|
void |
zoomOut()
Decreases the current zoom level by one if possible.
|
addObserver, notifyObservers, removeObserverpublic MapViewPosition(DisplayModel displayModel)
public void animateTo(LatLong pos)
public boolean animationInProgress()
public void destroy()
public LatLong getCenter()
public BoundingBox getMapLimit()
public MapPosition getMapPosition()
public LatLong getPivot()
public Point getPivotXY(byte zoomLevel)
zoomLevel - the zoomlevel to compute the x/y coordinates forpublic double getScaleFactor()
public byte getZoomLevel()
public byte getZoomLevelMax()
public byte getZoomLevelMin()
public void init(PreferencesFacade preferencesFacade)
init in interface Persistablepublic void moveCenter(double moveHorizontal,
double moveVertical)
moveHorizontal - the amount of pixels to move this MapViewPosition horizontally.moveVertical - the amount of pixels to move this MapViewPosition vertically.public void moveCenterAndZoom(double moveHorizontal,
double moveVertical,
byte zoomLevelDiff)
moveHorizontal - the amount of pixels to move this MapViewPosition horizontally.moveVertical - the amount of pixels to move this MapViewPosition vertically.public void save(PreferencesFacade preferencesFacade)
save in interface Persistablepublic void setCenter(LatLong latLong)
public void setMapLimit(BoundingBox mapLimit)
public void setMapPosition(MapPosition mapPosition)
public void setPivot(LatLong pivot)
pivot - lat/long of pivot point, null for map centerpublic void setScaleFactor(double scaleFactor)
public void setScaleFactorAdjustment(double adjustment)
public void setZoomLevel(byte zoomLevel)
IllegalArgumentException - if the zoom level is negative.public void setZoomLevelMax(byte zoomLevelMax)
public void setZoomLevelMin(byte zoomLevelMin)
public void zoom(byte zoomLevelDiff)
public void zoomIn()
public void zoomOut()
Copyright © 2014 mapsforge.org