Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GeoPoint

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

Hierarchy

  • GeoPoint

Index

Constructors

  • new GeoPoint(latitude?: string | number | { latitude: number; longitude: number } | [number, number], longitude?: number): GeoPoint
  • Parameters

    • Optional latitude: string | number | { latitude: number; longitude: number } | [number, 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 {@link GeoPoint#kilometersTo}

EARTH_RADIUS_IN_MILES: 3956 = 3956

The Earth radius in miles used by {@link GeoPoint#milesTo}

Methods

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

    see

    GeoPoint#radiansTo

    Parameters

    Returns number

    The distance in kilometers

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

    see

    GeoPoint#radiansTo

    Parameters

    Returns number

    The distance in miles

  • Returns a JSON representation of the GeoPoint

    Returns JsonMap

    A GeoJson object of this GeoPoint

  • toString(): string
  • A String representation in latitude, longitude format

    Returns string

    The string representation of this class

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

    Returns Promise<GeoPoint>

    A promise that will be resolved with a GeoPoint

Generated using TypeDoc