Package globus.glmap

Class MapPoint

java.lang.Object
globus.glmap.MapPoint
All Implemented Interfaces:
Serializable

public class MapPoint extends Object implements Serializable
MapPoint is used store coordinates in map internal format
See Also:
  • Field Details

    • Max

      public static final int Max
      Maximum valid value of x and y
      See Also:
    • x

      public double x
      X value
    • y

      public double y
      Y value
  • Constructor Details

    • MapPoint

      public MapPoint()
      Default constructor
    • MapPoint

      public MapPoint(double x, double y)
      Constructor with x and y
      Parameters:
      x - X coordinate. Valid values are in range [0, GLMapPointMax]
      y - Y coordinate. Valid values are in range [0, GLMapPointMax]
    • MapPoint

      public MapPoint(@NonNull MapGeoPoint geoPoint)
      Creates map point from geo coordinates
      Parameters:
      geoPoint - Geo point
    • MapPoint

      public MapPoint(@NonNull MapPoint point)
      Copies constructor
      Parameters:
      point - source point
  • Method Details

    • set

      public void set(@NonNull MapGeoPoint geoPoint)
      Sets coordinates of point from geo point
      Parameters:
      geoPoint - geo point.
    • CreateFromGeoCoordinates

      public static MapPoint CreateFromGeoCoordinates(double lat, double lon)
      Creates map point from geo coordinates
      Parameters:
      lat - latitude of point
      lon - longitude of point
      Returns:
      MapPoint converted from given coordinates
    • assign

      public MapPoint assign(@NonNull MapPoint point)
      Copies data from given point
      Parameters:
      point - source point
      Returns:
      this to use in chain operations
    • assign

      public MapPoint assign(double x, double y)
      Set x and y and return this
      Parameters:
      x - new x value
      y - bew y value
      Returns:
      this to use in chain operations
    • distance

      public double distance(double x, double y)
      Return distance to point
      Parameters:
      x - x of point
      y - y of point
      Returns:
      distance to point in internal coordinates
    • distance

      public double distance(MapPoint point)
      Return distance to point
      Parameters:
      point - point
      Returns:
      distance to point in internal coordinates
    • add

      public MapPoint add(@NonNull MapPoint other)
      Add x and y of other point
      Parameters:
      other - point
      Returns:
      this to use in chain operations
    • add

      public MapPoint add(double x, double y)
      Add x and y
      Parameters:
      x - x to add
      y - y to add
      Returns:
      this to use in chain operations
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object