Class: GeoBoundingBox

GeoBoundingBox()

The GeoBoundingBox model stores the geographical boundaries for an area on the Earth's surface. It includes the northernmost, southernmost, easternmost, and westernmost latitudes and longitudes, as well as an optional height parameter.

Constructor

new GeoBoundingBox()

Since:
  • 2.27.0
Source:

Extends

  • Backbone.Model

Members

type :String

The type of model this is.
Type:
  • String
Source:

Methods

boundsAreFullyContained(n, e, s, w) → {Boolean}

Check if another bounding box is fully contained within this bounding box.
Parameters:
Name Type Description
n Number The northernmost latitude of the bounding box.
e Number The easternmost longitude of the bounding box.
s Number The southernmost latitude of the bounding box.
w Number The westernmost longitude of the bounding box.
Source:
Returns:
True if the other bounding box is fully contained within this bounding box, false otherwise.
Type
Boolean

boundsAreFullyOutside(n, e, s, w) → {Boolean}

Check if another bounding box is fully outside of this bounding box.
Parameters:
Name Type Description
n Number The northernmost latitude of the bounding box.
e Number The easternmost longitude of the bounding box.
s Number The southernmost latitude of the bounding box.
w Number The westernmost longitude of the bounding box.
Source:
Returns:
True if the other bounding box is fully outside this bounding box, false otherwise.
Type
Boolean

coversEarth() → {Boolean}

Check if the bounding box covers the entire Earth.
Source:
Returns:
True if the bounding box covers the entire Earth, false otherwise.
Type
Boolean

defaults()

Overrides the default Backbone.Model.defaults() function to specify default attributes for the GeoBoundingBox.
Properties:
Name Type Attributes Description
north number | null The northernmost latitude of the bounding box. Should be a number between -90 and 90.
south number | null The southernmost latitude of the bounding box. Should be a number between -90 and 90.
east number | null The easternmost longitude of the bounding box. Should be a number between -180 and 180.
west number | null The westernmost longitude of the bounding box. Should be a number between -180 and 180.
height number | null <optional>
The height of the camera above the bounding box. Represented in meters above sea level. This attribute is optional and can be null.
Source:

getArea() → {Number}

Get the area of this bounding box in degrees.
Source:
Returns:
The area of the bounding box in degrees. Will return the globe's area if the bounding box is invalid.
Type
Number

getCoords() → {Object}

Return the four sides of the bounding box as an array.
Source:
Returns:
An object with the northernmost, southernmost, easternmost, and westernmost coordinates of the bounding box.
Type
Object

split() → {Array.<GeoBoundingBox>}

Splits the given bounding box if it crosses the prime meridian. Returns one or two new GeoBoundingBox models.
Source:
Returns:
An array of GeoBoundingBox models. One if the bounding box does not cross the prime meridian, two if it does.
Type
Array.<GeoBoundingBox>

validate(attrs)

Validate the model attributes
Parameters:
Name Type Description
attrs Object The model's attributes
Source: