Class MapArea

java.lang.Object
it.tidalwave.mapviewer.MapArea

public class MapArea extends Object
A rectangular area on the map.
Author:
Fabrizio Giudici
  • Constructor Details

    • MapArea

      public MapArea()
  • Method Details

    • of

      public static MapArea of(double north, double east, double south, double west)
      Returns a new area..
      Parameters:
      north - the north limit
      east - the east limit
      south - the south limit
      west - the west limit
      Returns:
      a new area
      Throws:
      IllegalArgumentException - when the values are unfeasible
    • getCenter

      @Nonnull public MapCoordinates getCenter()
      Returns the center of this area..
      Returns:
      the center of this area
    • isAcrossGreenwichAntimeridian

      public boolean isAcrossGreenwichAntimeridian()
      Returns true if this area spans across the Greenwich antimeridian (180° W)..
      Returns:
      true if this area spans across the Greenwich antimeridian (180° W)
    • contains

      public boolean contains(@Nonnull MapCoordinates coordinates)
      Returns true if this area contains the given coordinates..
      Parameters:
      coordinates - the coordinates
      Returns:
      true if this area contains the given coordinates
    • contains

      public boolean contains(@Nonnull MapArea that)
      Returns true if this area contains the given area..
      Parameters:
      that - the area to compare
      Returns:
      true if this area contains the given area
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object