latLonUtil
Summary
Item Index
Methods
arrayToBounds
Syntax
Summary
Converts an array of SW/NE coordinates to a google LatLngBounds object.
Parameters:
-
bounds
BoundsLatLons of SW and NE corners.
Returns:
arrayToLatLng
Syntax
Summary
Convert an array of latitude and longitude to Google's Lat/Lng object.
Parameters:
-
latLon
LatLon
Returns:
boundsToArray
Syntax
Summary
Parameters:
-
bounds
google.maps.LatLngBounds
Returns:
SW and NE Corner LatLons.
decimalToDegrees
Syntax
Summary
Converts a decimal coordinate to degrees.
eg. 45.1234567 --> [45, 7, 24.4452]
Parameters:
-
decimal
Number
degreesToDecimal
Syntax
Summary
Converts an array of [degrees, minutes, seconds] to a decimal coordinate.
eg. [45, 7, 24.4452] --> 45.1234567
Returns:
degreesToLatLon
Syntax
Summary
Converts a coordinate from degrees to decimal latLon.
eg. [[45, 7, 24.4452], [-90, 7, 24.4452]] --> [45.1234567, -90.1234567]
Parameters:
Returns:
LatLon coordinates as decimals.
findCloset
Syntax
findCloset
-
target
-
numbers
Summary
Find the number closet to a target number.
latLngToArray
Syntax
Summary
Converts a {google.maps.LatLng} object to a plain array
Parameters:
-
latLng
google.maps.LatLng
Returns:
latLngToPath
Syntax
Summary
Converts an array of {google.maps.LatLng} objects to a plain path array.
Parameters:
-
latLng
Array.<google.maps.LatLng>
Returns:
latLonToDegrees
Syntax
Summary
Converts a latLon coordinate to degrees, minutes, and seconds.
eg. [45.1234567, -90.1234567] --> [[45, 7, 24.4452], [-90, 7, 24.4452]]
Parameters:
-
latLon
LatLon
Returns:
Array of North and West coordinates as [degrees, minutes, seconds].
pathToLatLng
Syntax
Summary
Converts a path array to an array of {google.maps.LatLng} objects.
Parameters:
-
path
Path