Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LatLon

Represents a Latitude Longitude pair, expressed in degrees (WGS84 World Geodetic System projection).

Hierarchy

  • LatLon

Index

Constructors

constructor

  • new LatLon(latlonString: string): LatLon
  • new LatLon(latlon: ILatLon): LatLon
  • new LatLon(lat: number, lon: number, z?: number): LatLon
  • Creates a LatLon from a string representation.

    Parameters

    • latlonString: string

      The LatLon as a string of the form 'lat,lon'.

    Returns LatLon

  • Creates a LatLon using the properties of the given object, taking the value of the lng field as the longitude value if it is present, otherwise using the value of the lon property.

    Parameters

    • latlon: ILatLon

      The LatLon data, with either a lon property or a lng property.

    Returns LatLon

  • Creates a LatLon using the given values.

    Parameters

    • lat: number

      The latitude in degrees, between -90 and 90.

    • lon: number

      The longitude in degrees, between -180 and 180.

    • Optional z: number

      The z-level of the LatLon, between 0 and 15 (inclusive).

    Returns LatLon

Properties

lat

lat: number

The latitude (north-south) coordinate in degrees.

lon

lon: number

The longitude (east-west) coordinate in degrees.

z

z: number

The z-level (relative height) of this LatLon.

Static ASSEMBLY_NAME

ASSEMBLY_NAME: string = GEOBASE_ASSEMBLY_NAME

Static CLASS_NAME

CLASS_NAME: string = "Telogis.GeoBase.LatLon"

Methods

bearingTo

  • bearingTo(other: LatLon): number
  • Returns the bearing (in degrees) that you would need to travel in to move in a straight line from this LatLon to another LatLon.

    Parameters

    Returns number

closestPointOnLine

  • Calculates the closest point on the line lineStart->lineEnd to the point given.

    Parameters

    Returns LatLon

distanceTo

  • Returns the distance from this LatLon to another LatLon in the specified units.

    Parameters

    Returns number

equals

  • equals(latlon: ILatLon): boolean
  • equals(lat: number, lon: number, z?: number): boolean
  • Checks whether this LatLon and another LatLon represent the same point.

    Parameters

    • latlon: ILatLon

      The LatLon to compare this instance to.

    Returns boolean

  • Checks whether this LatLon and another LatLon represent the same point.

    Parameters

    • lat: number

      The latitude to compare to.

    • lon: number

      The longitude to compare to.

    • Optional z: number

      The z coordinate to compare to. Optional.

    Returns boolean

isValid

  • isValid(): boolean
  • Returns true if this LatLon has been assigned a valid value.

    Returns boolean

toJson

  • toJson(): Object
  • Returns Object

toString

  • toString(): string
  • Returns the coordinates of this LatLon in the form "(Lat, Lon)".

    Returns string

translateOnBearing

  • Parameters

    Returns LatLon

Generated using TypeDoc