Click or drag to resize

Telogis.GeoBase.LatLon

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
LatLon Class

Represents a latitude-longitude coordinate pair, expressed in degrees (WGS84 World Geodetic System projection).

Constructor
NameDescription
LatLon(lat, lon)

Arguments

  • (Optional)lat (Number) - The north-south component of the coordinate pair, in degrees. Increasing latitude values indicate coordinates further north; decreasing values south. Instead of a number, another LatLon may be passed here to invoke a copy constructor. Defaults to 0.0.

  • (Optional)lon (Number) - The east-west component of the coordinate pair, in degrees. Increasing longitude values indicate coordinates further east; decreasing values west. Defaults to 0.0.

Functions
NameDescription
distanceTo (LatLon other, String units)

Calculates the distance between two coordinates in the requested LatLon.distanceTo.units.

Arguments
  • other (LatLon) - The location to measure the distance to.

  • units (String) - The string abbreviation of the units that the requested distance should be measured in, which should be a DistanceUnit code.

Returns

Number - The distance in given LatLon.distanceTo.units from the base object to the LatLon.distanceTo.other object.

equals (LatLon other, Number tolerance)

Determines whether two coordinates are the same.

Arguments
  • other (LatLon) - The other coordinate to compare.

  • (Optional) tolerance (Number) - The permissible differences in latitude and longitude, in degrees, to allow while still deeming the coordinates equivalent -- for example, to allow for rounding or approximation error. Defaults to 0.

Returns

Boolean - Whether the latitude and longitude coordinates of the caller and LatLon.equals.other are equivalent.

isValid ()

True only if this LatLon has been assigned a valid value.

Returns

Boolean - Whether this LatLon has been assigned a valid value (i.e. lat between -90 and 90 and lon between -180 and 180 inclusive).

isValid ()

True only if this LatLon has been assigned a valid value.

Returns

Boolean - Whether this LatLon has been assigned a valid value (i.e. lat between -90 and 90 and lon between -180 and 180 inclusive).

toString (Number precision)

Gets a string representation of the coordinates represented by the current LatLon.

Arguments
  • (Optional) precision (Number) - The precision of decimal places to give the coordinates to. Defaults to 6.

Returns

String - A string of the form '($lat, $lon)'.

wrap ()

Finds a coordinate pair whose longitude is wrapped to a corresponding value between -180.0 and 180.0. Internally, this longitude exceeds these conventional bounds in order to preserve wrapping information, which is necessary for displaying maps at low zoom levels where the same point can occur twice and constructs such as MapLayers.RegionShadeLayers and MapLayers.ObjectLayers need to take this into account.

Returns

LatLon - A pair of latitude-longitude coordinates with the longitude modulated to a conventional value.

Properties
NameTypeDescription
latNumber

The north-south component of the coordinate pair, in degrees.

lonNumber

The east-west component of the coordinate pair, in degrees.

SERIAL_DPNumber

The number of decimal places that the LatLon.lat and LatLon.lon properties of LatLon instances should be specified to when they are serialized to be sent to the GeoStream server.