dojo.require("esri.geometry.Extent")
Description
(Added at v1.0)
The minimum and maximum X- and Y- coordinates of a bounding box.
Samples
Search for
samples that use this class.
Class hierarchy
esri/geometry.Geometry
|_esri/geometry.Extent
Constructors
Properties
Methods
Constructor Details
Creates a new Extent object. The coordinates represent the lower left and upper right corners of the bounding box. A spatial reference is also required.
Parameters:
<Number > xmin |
Required |
Bottom-left X-coordinate of an extent envelope. |
<Number > ymin |
Required |
Bottom-left Y-coordinate of an extent envelope. |
<Number > xmax |
Required |
Top-right X-coordinate of an extent envelope. |
<Number > ymax |
Required |
Top-right Y-coordinate of an extent envelope. |
<SpatialReference > spatialReference |
Required |
Spatial reference of the geometry. |
Sample:
var extent = new esri.geometry.Extent(-122.68,45.53,-122.45,45.60, new esri.SpatialReference({ wkid:4326 }));
Creates a new Extent object using a JSON object.
Parameters:
<Object > json |
Required |
JSON object representing the geometry. |
Sample:
var extent = new esri.geometry.Extent({"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,
"spatialReference":{"wkid":4326}});
Property Details
The cache is used to store values computed from geometries that need to cleared or recomputed upon mutation. An example is the extent of a polygon. The default value is undefined
. (Added at v3.13)
Default value: undefined
The type of geometry.
Known values: point
| multipoint
| polyline
| polygon
| extent
Top-right X-coordinate of an extent envelope.
Bottom-left X-coordinate of an extent envelope.
Top-right Y-coordinate of an extent envelope.
Bottom-left Y-coordinate of an extent envelope.
Method Details
A new extent is returned with the same width and height centered at the argument point.
Parameters:
<Point > point |
Required |
Centers the extent on the specified x,y location. |
Sets the cache property to undefined
. (Added at v3.13)
When "true", the geometry in the argument is contained in this extent.
Sample:
var extent = map.extent;
if(extent.contains(graphic.geometry)) {
graphic.setSymbol(highlightSymbol);
}
Expands the extent by the factor given. For example, a value of 1.5 will be 50% bigger.
Parameters:
<Number > factor |
Required |
The multiplier value. |
Sample:
map.setExtent(points.getExtent().expand(3));
Returns the value for a named property stored in the cache. (Added at v3.13)
Parameters:
<String > name |
Required |
The property name of the value to retrieve from the cache. |
Returns the center point of the extent in map units.
Distance between ymin and ymax.
Distance between xmin and xmax.
Returns the intersection extent if the input geometry is an extent that intersects this extent. Boolean is returned when passing in non-Extent geometry types.
Sample:
var polygonExtent = polygon.getExtent();
if (polygonExtent.intersects(map.extent)) {
alert("Polygon intersects current map extent");
}
Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the dateline. (Added at v3.12)
Returns a new Extent with x and y offsets. Units are map units.
Parameters:
<Number > dx |
Required |
The offset distance in map units for the x-coordinate. |
<Number > dy |
Required |
The offset distance in map units for the y-coordinate. |
Sets the value for a named property stored in the cache. (Added at v3.13)
Parameters:
<String > name |
Required |
The property name for the value Object to store in the cache. |
<Object > value |
Required |
The value Object for a named property to store in the cache. |
Sets the spatial reference.
Returns an extent with a spatial reference with a custom shifted central meridian if the extent intersects the dateline. (Added at v3.12)
Expands this extent to include the extent of the argument.NOTE: Performing a Union returns a new extent as opposed to modifying the existing extent.
Parameters:
<Extent > extent |
Required |
The minx, miny, maxx, and maxy bounding box. |
Updates this extent with the specified parameters.
Parameters:
<Number > xmin |
Required |
Bottom-left X-coordinate of an extent envelope. |
<Number > ymin |
Required |
Bottom-left Y-coordinate of an extent envelope. |
<Number > xmax |
Required |
Top-right X-coordinate of an extent envelope. |
<Number > ymax |
Required |
Top-right Y-coordinate of an extent envelope. |
<SpatialReference > spatialReference |
Required |
Spatial reference of the geometry. |