Class MapViewProjection

java.lang.Object
org.mapsforge.map.util.MapViewProjection

public class MapViewProjection extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.mapsforge.core.model.LatLong
    fromPixels(double x, double y)
    Computes the geographic coordinates of a screen point.
    double
    Computes vertical extend of the map view.
    double
    Computes horizontal extend of the map view.
    org.mapsforge.core.model.Point
    toPixels(org.mapsforge.core.model.LatLong in)
    Converts geographic coordinates to view x/y coordinates in the map view.
    org.mapsforge.core.model.Point
    toPixels(org.mapsforge.core.model.LatLong in, boolean withRotation)
    Converts geographic coordinates to view x/y coordinates in the map view.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapViewProjection

      public MapViewProjection(MapView mapView)
  • Method Details

    • fromPixels

      public org.mapsforge.core.model.LatLong fromPixels(double x, double y)
      Computes the geographic coordinates of a screen point.
      Returns:
      the coordinates of the x/y point
    • getLatitudeSpan

      public double getLatitudeSpan()
      Computes vertical extend of the map view.
      Returns:
      the latitude span of the map in degrees
    • getLongitudeSpan

      public double getLongitudeSpan()
      Computes horizontal extend of the map view.
      Returns:
      the longitude span of the map in degrees
    • toPixels

      public org.mapsforge.core.model.Point toPixels(org.mapsforge.core.model.LatLong in)
      Converts geographic coordinates to view x/y coordinates in the map view.
      Parameters:
      in - the geographic coordinates
      Returns:
      x/y view coordinates for the given location
    • toPixels

      public org.mapsforge.core.model.Point toPixels(org.mapsforge.core.model.LatLong in, boolean withRotation)
      Converts geographic coordinates to view x/y coordinates in the map view. Optionally using the map rotation and map view center.
      Parameters:
      in - the geographic coordinates
      withRotation - post process with map rotation and map view center
      Returns:
      x/y view coordinates for the given location