Package org.oscim.map

Class ViewController

java.lang.Object
org.oscim.map.Viewport
org.oscim.map.ViewController

public class ViewController extends Viewport
  • Field Details

    • mNextFrame

      public final Viewport 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

      public static void applyRotation(double mx, double my, float bearing, Point out)
      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

      public void setMapPosition(MapPosition mapPosition)
    • getSyncViewport

      public final Viewport getSyncViewport()
      synchronize on this object when doing multiple calls on it
    • syncViewport

      public void syncViewport()
    • getSyncViewport

      public boolean getSyncViewport(Viewport v)
    • getSyncMapPosition

      public boolean getSyncMapPosition(MapPosition mapPosition)