Package org.oscim.map
Class ViewController
java.lang.Object
org.oscim.map.Viewport
org.oscim.map.ViewController
-
Field Summary
FieldsFields inherited from class org.oscim.map.Viewport
MAX_TILT, MAX_ZOOM_LEVEL, mHeight, MIN_TILT, MIN_ZOOM_LEVEL, mMaxBearing, mMaxRoll, mMaxScale, mMaxTilt, mMaxX, mMaxY, mMinBearing, mMinRoll, mMinScale, mMinTilt, mMinX, mMinY, mMovePoint, mPos, mProjMatrix, mProjMatrixInverse, mProjMatrixUnscaled, mRotationMatrix, mTmpMatrix, mu, mUnprojMatrix, mv, mViewCoords, mViewMatrix, mViewProjMatrix, mWidth, VIEW_DISTANCE, VIEW_FAR, VIEW_NEAR, VIEW_SCALE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyRotation(double mx, double my, float bearing, Point out) float[]Get pivot horizontal / vertical relative to view center in [-1, 1].floatGet pivot horizontal relative to view center in [-1, 1].floatGet pivot vertical relative to view center in [-1, 1].booleangetSyncMapPosition(MapPosition mapPosition) final Viewportsynchronize on this object when doing multiple calls on itbooleanvoidmoveMap(float mx, float my) Moves this Viewport by the given amount of pixels.voidrollMap(float move) voidrotateMap(double radians, float pivotX, float pivotY) Rotate map by radians around pivot.booleanscaleMap(float scale, float pivotX, float pivotY) Scale map by scale width center at pivot in pixel relative to view center.voidsetMapPosition(MapPosition mapPosition) voidsetMapViewCenter(float pivotX, float pivotY) Set pivot horizontal / vertical relative to view center in [-1, 1].voidsetMapViewCenterX(float pivotX) Set pivot horizontal relative to view center in [-1, 1].voidsetMapViewCenterY(float pivotY) Set pivot horizontal / vertical relative to view center in [-1, 1].voidsetRoll(double degree) voidsetRotation(double degree) booleansetTilt(float tilt) voidsetViewSize(int width, int height) voidbooleantiltMap(float move) Methods inherited from class org.oscim.map.Viewport
copy, fromScreenPoint, fromScreenPoint, getBBox, getMapExtents, getMapLimit, getMapPosition, getMaxBearing, getMaxRoll, getMaxScale, getMaxTilt, getMaxX, getMaxY, getMaxZoomLevel, getMinBearing, getMinRoll, getMinScale, getMinTilt, getMinX, getMinY, getMinZoomLevel, limitPosition, limitScale, limitTilt, setMapLimit, setMapLimit, setMaxBearing, setMaxRoll, setMaxScale, setMaxTilt, setMaxX, setMaxY, setMaxZoomLevel, setMinBearing, setMinRoll, setMinScale, setMinTilt, setMinX, setMinY, setMinZoomLevel, toScreenPoint, toScreenPoint, toScreenPoint, toScreenPoint, unproject, unprojectScreen
-
Field Details
-
mNextFrame
-
-
Constructor Details
-
ViewController
public ViewController()
-
-
Method Details
-
setViewSize
public void setViewSize(int width, int height) -
getMapViewCenter
public float[] getMapViewCenter()Get pivot horizontal / vertical relative to view center in [-1, 1]. e.g. pivotY 0.5 is usually preferred for navigation, moving center to 25% of view height. -
getMapViewCenterX
public float getMapViewCenterX()Get pivot horizontal relative to view center in [-1, 1]. -
getMapViewCenterY
public float getMapViewCenterY()Get pivot vertical relative to view center in [-1, 1]. e.g. pivotY 0.5 is usually preferred for navigation, moving center to 25% of view height. -
setMapViewCenter
public void setMapViewCenter(float pivotX, float pivotY) Set pivot horizontal / vertical relative to view center in [-1, 1]. e.g. pivotY 0.5 is usually preferred for navigation, moving center to 25% of view height. -
setMapViewCenterX
public void setMapViewCenterX(float pivotX) Set pivot horizontal relative to view center in [-1, 1]. -
setMapViewCenterY
public void setMapViewCenterY(float pivotY) Set pivot horizontal / vertical relative to view center in [-1, 1]. e.g. pivotY 0.5 is usually preferred for navigation, moving center to 25% of view height. -
moveMap
public void moveMap(float mx, float my) Moves this Viewport by the given amount of pixels.- Parameters:
mx- the amount of pixels to move the map horizontally.my- the amount of pixels to move the map vertically.
-
applyRotation
- Parameters:
mx- the amount of pixels to move the map horizontally.my- the amount of pixels to move the map vertically.bearing- the bearing to rotate the map.out- the position where to move.
-
scaleMap
public boolean scaleMap(float scale, float pivotX, float pivotY) Scale map by scale width center at pivot in pixel relative to view center. Map scale is clamp to MIN_SCALE and MAX_SCALE.- Returns:
- true if scale was changed
-
rotateMap
public void rotateMap(double radians, float pivotX, float pivotY) Rotate map by radians around pivot. Pivot is in pixel relative to view center. -
setRotation
public void setRotation(double degree) -
rollMap
public void rollMap(float move) -
setRoll
public void setRoll(double degree) -
tiltMap
public boolean tiltMap(float move) -
setTilt
public boolean setTilt(float tilt) -
setMapPosition
-
getSyncViewport
synchronize on this object when doing multiple calls on it -
syncViewport
public void syncViewport() -
getSyncViewport
-
getSyncMapPosition
-