Class: LatLng

LatLng

WPGMZA.LatLng

new LatLng(arg [, lng])

This class represents a latitude and longitude coordinate pair, and provides utilities to work with coordinates, parsing and conversion.
Parameters:
Name Type Argument Description
arg number | object A latLng literal, or latitude
lng number <optional>
The latitude, where arg is a longitude

Members


<static, constant> REGEXP :RegExp

A regular expression which matches latitude and longitude coordinate pairs from a string. Matches 1 and 3 correspond to latitude and longitude, respectively,
Type:
  • RegExp

Methods


<static> fromGoogleLatLng(The)

Returns an instnace of WPGMZA.LatLng from an instance of google.maps.LatLng
Parameters:
Name Type Description
The google.maps.LatLng google.maps.LatLng to convert
Returns:
An instance of WPGMZA.LatLng built from the supplied google.maps.LatLng
Type
WPGMZA.LatLng

<static> isValid(obj)

Returns true if the supplied object is a LatLng literal, also returns true for instances of WPGMZA.LatLng
Parameters:
Name Type Description
obj object A LatLng literal, or an instance of WPGMZA.LatLng
Returns:
True if this object is a valid LatLng literal or instance of WPGMZA.LatLng
Type
bool

moveByDistance(kilometers, heading)

Moves this latLng by the specified kilometers along the given heading. This function operates in place, as opposed to creating a new instance of WPGMZA.LatLng. With many thanks to Hu Kenneth - https://gis.stackexchange.com/questions/234473/get-a-lonlat-point-by-distance-or-between-2-lonlat-points
Parameters:
Name Type Description
kilometers number The number of kilometers to move this LatLng by
heading number The heading, in degrees, to move along, where zero is North
Returns:
Type
void

toGoogleLatLng()

Returns an instance of google.maps.LatLng with the same coordinates as this object
Returns:
This object, expressed as a google.maps.LatLng
Type
google.maps.LatLng

toString()

Returns this latitude and longitude as a string
Returns:
This object represented as a string
Type
string