Class eniro.maps.LatLngBounds
Extends
eniro.maps.Bounds.
Defined in: LatLngBounds.js.
Constructor Attributes | Constructor Name and Description |
---|---|
eniro.maps.LatLngBounds(sw, ne)
Represents a rectangle in geographical coordinates.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
eniro.maps.LatLngBounds.make(lat1, lng1, lat2, lng2)
Shorthand for quickly making bounds from two coordinates.
|
toUrlValue(precision, latLngReverse)
Turns this bounds into a URL bounds value on the form sw.lat(),sw.lng(),ne.lat(),ne.lng().
|
- Methods borrowed from class eniro.maps.Bounds:
- contains, equals, exactEquals, extend, getCenter, getNe, getSrs, getSw, intersects, isEmpty, toSpan, transform, union
Class Detail
eniro.maps.LatLngBounds(sw, ne)
Represents a rectangle in geographical coordinates. The rectangle is made up out of a south west and a north east
corner.
Class is considered a value type. This class does not currently handle bounds that span the 180 degree longitudal meridian line.
- Parameters:
- {eniro.maps.LatLng} sw
- The south west corner.
- {eniro.maps.LatLng} ne
- The north east corner.
- Throws:
- Error if the eniro.maps.Srs of the two corners don't match.
Method Detail
<static>
{eniro.maps.LatLngBounds}
eniro.maps.LatLngBounds.make(lat1, lng1, lat2, lng2)
Shorthand for quickly making bounds from two coordinates.
- Parameters:
- {number} lat1
- Latitude of coordinate 1
- {number} lng1
- Longitude of coordinate 1
- {number} lat2
- Latitude of coordinate 2
- {number} lng2
- Longitude of coordinate 2
- Returns:
- {eniro.maps.LatLngBounds}
{string}
toUrlValue(precision, latLngReverse)
Turns this bounds into a URL bounds value on the form sw.lat(),sw.lng(),ne.lat(),ne.lng(). Our standard
is lat,lng - others, notably OpenLayers do lng,lat. There's a parameter to to control the reverse order.
- Parameters:
- {number} precision Optional, Default: 6
- The number of decimals to use in each value, default is 6.
- {boolean} latLngReverse Optional, Default: false
- If we are to reverse the lat,lng to be lng,lat OpenLayers style, default is false.
- Returns:
- {string} the bounds, ready to be used in a URL.