Class: ExtentE-mail This Topic Printable Version Give Us Feedback

Description

The minimum and maximum X- and Y- coordinates of a bounding box.

Class hierarchy

esri.geometry.Geometry
  |_ esri.geometry.Extent

Constructor

Constructor Description
esri.geometry.Extent(xmin, ymin, xmax, ymax, spatialReference) 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.
esri.geometry.Extent(json) Creates a new Extent object using a JSON object.

Properties

Property Type Description
xmax Number Top-right X-coordinate of an extent envelope.
xmin Number Bottom-left X-coordinate of an extent envelope.
ymax Number Top-right Y-coordinate of an extent envelope.
ymin Number Bottom-left Y-coordinate of an extent envelope.

Methods

Method Return Value Description
centerAt(point) Extent A new extent is returned with the same width and height centered at the argument point.
contains(point) Boolean When "true", the point in the argument is contained in this extent.
expand(factor) Extent Expands the extent by the factor given. For example, a value of 1.5 will be 50% bigger.
getCenter() Point Returns the center point of the extent in map units.
getHeight() Number Distance between ymin and ymax.
getWidth() Number Distance between xmin and xmax.
intersects(extent) Extent When "true", the extent in the argument intersects this extent.
offset(dx, dy) Extent Offsets the current extent. Units are map units.
union(extent) Extent Expands this extent to include the extent of the argument.
update(xmin, xmin, xmax, ymax, spatialReference) Extent Updates this extent with the specified parameters.

The return value of Extent was added at v1.4.
Constructor Detail

esri.geometry.Extent(xmin, ymin, xmax, ymax, spatialReference)

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.

esri.geometry.Extent(json)

Creates a new Extent object using a JSON object.
Parameters:
<Object> json Required JSON object representing the geometry.
Properties Detail

<Number> xmax

Top-right X-coordinate of an extent envelope.

<Number> xmin

Bottom-left X-coordinate of an extent envelope.

<Number> ymax

Top-right Y-coordinate of an extent envelope.

<Number> ymin

Bottom-left Y-coordinate of an extent envelope.
Methods Detail

centerAt(point)

A new extent is returned with the same width and height centered at the argument point.
Return value: Extent
Input Parameters:
<Point> point Required Centers the extent on the specified x,y location.

contains(point)

When "true", the point in the argument is contained in this extent.
Return value: Boolean
Input Parameters:
<Point> point Required The location defined by an X- and Y- coordinate in map units.

expand(factor)

Expands the extent by the factor given. For example, a value of 1.5 will be 50% bigger.
Return value: Extent
Input Parameters:
<Number> factor Required The mulitplier value.

getCenter()

Returns the center point of the extent in map units.
Return value: Point

getHeight()

Distance between ymin and ymax.
Return value: Number

getWidth()

Distance between xmin and xmax.
Return value: Number

intersects(extent)

When "true", the extent in the argument intersects this extent.
Return value: Extent
Input Parameters:
<Extent> extent Required The minx, miny, maxx, and maxy bounding box.
Code snippets:
var polygonExtent = polygon.getExtent();
if (polygonExtent.intersects(map.extent)) {
  alert("Polygon intersects current map extent");
}

offset(dx, dy)

Offsets the current extent. Units are map units.
Return value: Extent
Input Parameters:
<Number> dx Required The offset distance in map units for the y-coordinate.
<Number> dy Required The offset distance in map units for the x-coordinate.

union(extent)

Expands this extent to include the extent of the argument.
Return value: Extent
Input Parameters:
<Extent> extent Required The minx, miny, maxx, and maxy bounding box.

update(xmin, xmin, xmax, ymax, spatialReference)

Updates this extent with the specified parameters.

The return value of Extent was added at v1.4.
Return value: Extent
Input Parameters:
<Number> xmin Required Bottom-left X-coordinate of an extent envelope.
<Number> xmin 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.