Class GeoPoint

Creates a new GeoPoint instance From latitude and longitude From a json object Or an tuple of latitude and longitude

Hierarchy

  • GeoPoint

Constructors

  • Parameters

    • Optional latitude: string | number | [number, number] | {
          latitude: number;
          longitude: number;
      }

      A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude

    • Optional longitude: number

      The GeoPoint's longitude

    Returns GeoPoint

Properties

latitude: number

Latitude of the given point

longitude: number

Longitude of the given point

DEG_TO_RAD: number = ...

How many radians fit in one degree.

EARTH_RADIUS_IN_KILOMETERS: 6371 = 6371

The Earth radius in kilometers used by kilometersTo

EARTH_RADIUS_IN_MILES: 3956 = 3956

The Earth radius in miles used by milesTo

Methods

  • Returns the distance from this GeoPoint to another in kilometers.

    Returns

    The distance in kilometers

    See

    GeoPoint#radiansTo

    Parameters

    Returns number

  • Returns the distance from this GeoPoint to another in miles.

    Returns

    The distance in miles

    See

    GeoPoint#radiansTo

    Parameters

    Returns number

  • Returns a JSON representation of the GeoPoint

    Returns

    A GeoJson object of this GeoPoint

    Returns JsonMap

  • A String representation in latitude, longitude format

    Returns

    The string representation of this class

    Returns string

  • Creates a GeoPoint with the user's current location, if available.

    Returns

    A promise that will be resolved with a GeoPoint

    Returns Promise<GeoPoint>

Generated using TypeDoc