Class mxn.BoundingBox
Defined in: mxn.core.js.
Constructor Attributes | Constructor Name and Description |
---|---|
mxn.BoundingBox(swlat, swlon, nelat, nelon)
BoundingBox creates a new bounding box object
|
Method Attributes | Method Name and Description |
---|---|
contains(point)
contains finds whether a given point is within a bounding box
|
|
extend(point)
extend extends the bounding box to include the new point
|
|
getCenter calculates the center of a bounding box.
|
|
getNorthEast returns a LatLonPoint of the north-east point of the bounding box
|
|
getSouthWest returns a LatLonPoint of the south-west point of the bounding box
|
|
isEmpty()
isEmpty finds if this bounding box has zero area
|
|
toSpan()
toSpan returns a LatLonPoint with the lat and lon as the height and width of the bounding box
|
Class Detail
mxn.BoundingBox(swlat, swlon, nelat, nelon)
BoundingBox creates a new bounding box object
- Parameters:
- {double} swlat
- the latitude of the south-west point
- {double} swlon
- the longitude of the south-west point
- {double} nelat
- the latitude of the north-east point
- {double} nelon
- the longitude of the north-east point
Method Detail
{boolean}
contains(point)
contains finds whether a given point is within a bounding box
- Parameters:
- {LatLonPoint} point
- the point to test with
- Returns:
- whether point is within this bounding box
extend(point)
extend extends the bounding box to include the new point
- Parameters:
- point
getCenter()
getCenter calculates the center of a bounding box.
- Returns:
- a LatLonPoint at the center of this bounding box.
{LatLonPoint}
getNorthEast()
getNorthEast returns a LatLonPoint of the north-east point of the bounding box
- Returns:
- the north-east point of the bounding box
{LatLonPoint}
getSouthWest()
getSouthWest returns a LatLonPoint of the south-west point of the bounding box
- Returns:
- the south-west point of the bounding box
{boolean}
isEmpty()
isEmpty finds if this bounding box has zero area
- Returns:
- whether the north-east and south-west points of the bounding box are the same point
{LatLonPoint}
toSpan()
toSpan returns a LatLonPoint with the lat and lon as the height and width of the bounding box
- Returns:
- a LatLonPoint containing the height and width of this bounding box