public class MapViewPosition extends Observable implements 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() |
org.mapsforge.core.model.LatLong |
getCenter() |
org.mapsforge.core.model.BoundingBox |
getMapLimit() |
org.mapsforge.core.model.MapPosition |
getMapPosition() |
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() |
byte |
getZoomLevel() |
byte |
getZoomLevelMax() |
byte |
getZoomLevelMin() |
void |
init(PreferencesFacade preferencesFacade) |
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) |
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, removeObserver
public MapViewPosition(DisplayModel displayModel)
public void animateTo(org.mapsforge.core.model.LatLong latLong)
public boolean animationInProgress()
public void destroy()
public org.mapsforge.core.model.LatLong getCenter()
public org.mapsforge.core.model.BoundingBox getMapLimit()
public org.mapsforge.core.model.MapPosition getMapPosition()
public org.mapsforge.core.model.LatLong getPivot()
public org.mapsforge.core.model.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 Persistable
public 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 moveCenter(double moveHorizontal, double moveVertical, boolean animated)
moveHorizontal
- 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)
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.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)
save
in interface Persistable
public void setCenter(org.mapsforge.core.model.LatLong latLong)
public void setMapLimit(org.mapsforge.core.model.BoundingBox mapLimit)
public void setMapPosition(org.mapsforge.core.model.MapPosition mapPosition)
public void setMapPosition(org.mapsforge.core.model.MapPosition mapPosition, boolean animated)
public void setPivot(org.mapsforge.core.model.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)
java.lang.IllegalArgumentException
- if the zoom level is negative.public void setZoomLevel(byte zoomLevel, boolean animated)
zoomLevel
- 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)
public void setZoomLevelMin(byte zoomLevelMin)
public void zoom(byte zoomLevelDiff)
public void zoom(byte zoomLevelDiff, boolean animated)
public void zoomIn()
public void zoomIn(boolean animated)
public void zoomOut()
public void zoomOut(boolean animated)