Class LatLng
This class represents a latitude and longitude coordinate pair, provides type consistency for latitude and longitude, and some utility functions
Methods summary
public
|
#
__construct( mixed $arg = null, mixed $lng = null )
Constructor
Parameters
- $arg
- Can be a string matching LatLng::REGEXP, or an object/array with lat and lng set.
- $lng
- Where $arg is a number, it will be treated as a float, you should supply a number to $lng too.
|
public
|
#
__get( $name )
Gets the specified property.
Gets the specified property.
|
public
|
#
__set( $name, $value )
Sets the specified property.
Sets the specified property.
Throws
Exception The value is not numeric (int, float or a numeric string)
|
public
|
#
__toString( )
Returns this coordinate pair as a comma separated string.
Returns this coordinate pair as a comma separated string.
|
Constants summary
string |
REGEXP
Const
A regular expression to match a coordinate pair from a string. The latitdue and longitude will be in matches 1 and 3 respectively.
|
#
'/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/'
|