new Rectangle(west, south, east, north)
A two dimensional region specified as longitude and latitude coordinates.
| Name | Type | Default | Description |
|---|---|---|---|
west |
Number |
0.0
|
optional The westernmost longitude, in radians, in the range [-Pi, Pi]. |
south |
Number |
0.0
|
optional The southernmost latitude, in radians, in the range [-Pi/2, Pi/2]. |
east |
Number |
0.0
|
optional The easternmost longitude, in radians, in the range [-Pi, Pi]. |
north |
Number |
0.0
|
optional The northernmost latitude, in radians, in the range [-Pi/2, Pi/2]. |
See:
Source:
Core/Rectangle.js, line 35
Members
-
staticconstantRectangle.MAX_VALUE :Rectangle
-
The largest possible rectangle.Source: Core/Rectangle.js, line 700
-
staticRectangle.packedLength :Number
-
The number of elements used to pack the object into an array.Source: Core/Rectangle.js, line 97
-
east :Number
-
The easternmost longitude in radians in the range [-Pi, Pi].
-
Default Value:
0.0Source: Core/Rectangle.js, line 58 -
height :Number
-
Gets the height of the rectangle in radians.Source: Core/Rectangle.js, line 86
-
north :Number
-
The northernmost latitude in radians in the range [-Pi/2, Pi/2].
-
Default Value:
0.0Source: Core/Rectangle.js, line 66 -
south :Number
-
The southernmost latitude in radians in the range [-Pi/2, Pi/2].
-
Default Value:
0.0Source: Core/Rectangle.js, line 50 -
west :Number
-
The westernmost longitude in radians in the range [-Pi, Pi].
-
Default Value:
0.0Source: Core/Rectangle.js, line 42 -
width :Number
-
Gets the width of the rectangle in radians.Source: Core/Rectangle.js, line 75
Methods
-
staticRectangle.center(rectangle, result) → Cartographic
-
Computes the center of an rectangle.
Name Type Description rectangleRectangle The rectangle for which to find the center resultCartographic optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartographic instance if none was provided.Source: Core/Rectangle.js, line 492 -
staticRectangle.clone(rectangle, result) → Rectangle
-
Duplicates an Rectangle.
Name Type Description rectangleRectangle The rectangle to clone. resultRectangle optional The object onto which to store the result, or undefined if a new instance should be created. Returns:
The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)Source: Core/Rectangle.js, line 261 -
staticRectangle.computeHeight(rectangle) → Number
-
Computes the height of a rectangle in radians.
Name Type Description rectangleRectangle The rectangle to compute the height of. Returns:
The height.Source: Core/Rectangle.js, line 176 -
staticRectangle.computeWidth(rectangle) → Number
-
Computes the width of a rectangle in radians.
Name Type Description rectangleRectangle The rectangle to compute the width of. Returns:
The width.Source: Core/Rectangle.js, line 157 -
staticRectangle.contains(rectangle, cartographic) → Boolean
-
Returns true if the cartographic is on or inside the rectangle, false otherwise.
Name Type Description rectangleRectangle The rectangle cartographicCartographic The cartographic to test. Returns:
true if the provided cartographic is inside the rectangle, false otherwise.Source: Core/Rectangle.js, line 586 -
staticRectangle.equals(left, right) → Boolean
-
Compares the provided rectangles and returns
trueif they are equal,falseotherwise.Name Type Description leftRectangle optional The first Rectangle. rightRectangle optional The second Rectangle. Returns:
trueif left and right are equal; otherwisefalse.Source: Core/Rectangle.js, line 306 -
staticRectangle.fromCartographicArray(cartographics, result) → Rectangle
-
Creates the smallest possible Rectangle that encloses all positions in the provided array.
Name Type Description cartographicsArray.<Cartographic> The list of Cartographic instances. resultRectangle optional The object onto which to store the result, or undefined if a new instance should be created. Returns:
The modified result parameter or a new Rectangle instance if none was provided.Source: Core/Rectangle.js, line 223 -
staticRectangle.fromDegrees(west, south, east, north, result) → Rectangle
-
Creates an rectangle given the boundary longitude and latitude in degrees.
Name Type Default Description westNumber 0.0optional The westernmost longitude in degrees in the range [-180.0, 180.0]. southNumber 0.0optional The southernmost latitude in degrees in the range [-90.0, 90.0]. eastNumber 0.0optional The easternmost longitude in degrees in the range [-180.0, 180.0]. northNumber 0.0optional The northernmost latitude in degrees in the range [-90.0, 90.0]. resultRectangle optional The object onto which to store the result, or undefined if a new instance should be created. Returns:
The modified result parameter or a new Rectangle instance if none was provided.Example:
var rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);Source: Core/Rectangle.js, line 198 -
staticRectangle.intersection(rectangle, otherRectangle, result) → Rectangle|undefined
-
Computes the intersection of two rectangles
Name Type Description rectangleRectangle On rectangle to find an intersection otherRectangleRectangle Another rectangle to find an intersection resultRectangle optional The object onto which to store the result. Returns:
The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.Source: Core/Rectangle.js, line 527 -
staticRectangle.northeast(rectangle, result) → Cartographic
-
Computes the northeast corner of an rectangle.
Name Type Description rectangleRectangle The rectangle for which to find the corner resultCartographic optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartographic instance if none was provided.Source: Core/Rectangle.js, line 446 -
staticRectangle.northwest(rectangle, result) → Cartographic
-
Computes the northwest corner of an rectangle.
Name Type Description rectangleRectangle The rectangle for which to find the corner resultCartographic optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartographic instance if none was provided.Source: Core/Rectangle.js, line 423 -
staticRectangle.pack(value, array, startingIndex)
-
Stores the provided instance into the provided array.
Name Type Default Description valueRectangle The value to pack. arrayArray.<Number> The array to pack into. startingIndexNumber 0optional The index into the array at which to start packing the elements. Source: Core/Rectangle.js, line 106 -
staticRectangle.southeast(rectangle, result) → Cartographic
-
Computes the southeast corner of an rectangle.
Name Type Description rectangleRectangle The rectangle for which to find the corner resultCartographic optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartographic instance if none was provided.Source: Core/Rectangle.js, line 469 -
staticRectangle.southwest(rectangle, result) → Cartographic
-
Computes the southwest corner of an rectangle.
Name Type Description rectangleRectangle The rectangle for which to find the corner resultCartographic optional The object onto which to store the result. Returns:
The modified result parameter or a new Cartographic instance if none was provided.Source: Core/Rectangle.js, line 400 -
staticRectangle.subsample(rectangle, ellipsoid, surfaceHeight, result) → Array.<Cartesian3>
-
Samples an rectangle so that it includes a list of Cartesian points suitable for passing to
BoundingSphere#fromPoints. Sampling is necessary to account for rectangles that cover the poles or cross the equator.Name Type Default Description rectangleRectangle The rectangle to subsample. ellipsoidEllipsoid Ellipsoid.WGS84optional The ellipsoid to use. surfaceHeightNumber 0.0optional The height of the rectangle above the ellipsoid. resultArray.<Cartesian3> optional The array of Cartesians onto which to store the result. Returns:
The modified result parameter or a new Array of Cartesians instances if none was provided.Source: Core/Rectangle.js, line 626 -
staticRectangle.unpack(array, startingIndex, result)
-
Retrieves an instance from a packed array.
Name Type Default Description arrayArray.<Number> The packed array. startingIndexNumber 0optional The starting index of the element to be unpacked. resultRectangle optional The object into which to store the result. Source: Core/Rectangle.js, line 132 -
staticRectangle.validate(rectangle)
-
Checks an Rectangle's properties and throws if they are not in valid ranges.
Name Type Description rectangleRectangle The rectangle to validate Throws:
Source: Core/Rectangle.js, line 349 -
clone(result) → Rectangle
-
Duplicates this Rectangle.
Name Type Description resultRectangle optional The object onto which to store the result. Returns:
The modified result parameter or a new Rectangle instance if none was provided.Source: Core/Rectangle.js, line 283 -
equals(other) → Boolean
-
Compares the provided Rectangle with this Rectangle componentwise and returns
trueif they are equal,falseotherwise.Name Type Description otherRectangle optional The Rectangle to compare. Returns:
trueif the Rectangles are equal,falseotherwise.Source: Core/Rectangle.js, line 294 -
equalsEpsilon(other, epsilon) → Boolean
-
Compares the provided Rectangle with this Rectangle componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Name Type Description otherRectangle optional The Rectangle to compare. epsilonNumber The epsilon to use for equality testing. Returns:
trueif the Rectangles are within the provided epsilon,falseotherwise.Source: Core/Rectangle.js, line 325
