Packagecom.esri.ags.geometry
Classpublic class Extent
InheritanceExtent Inheritance Geometry

The minimum and maximum x- and y-coordinates of a bounding box.


Example
Specifying the extent of a Map using mxml tags inside the Map:
 <esri:Map>
     <esri:extent>
         <esri:Extent xmin="15" ymin="54" xmax="40" ymax="71">
             <esri:SpatialReference wkid="4326"/>
         </esri:Extent>
     </esri:extent>
 </esri:Map>

Specifying the extent of a Map using method property bound to an id:
 <esri:Extent id="myExtent" xmin="15" ymin="54" xmax="40" ymax="71" spatialReference="{new SpatialReference(4326)}"/>
 <esri:Map extent="{myExtent}"/>

See also

Concepts - Using Extent


Public Properties
 PropertyDefined by
  center : MapPoint
[read-only] Returns the centerpoint of the extent.
Extent
  extent : Extent
[read-only] The extent of this Extent.
Extent
  height : Number
[read-only] Distance between ymin and ymax.
Extent
 InheritedspatialReference : SpatialReference
The spatial reference of the geometry.
Geometry
  type : String
[read-only] The type of geometry is EXTENT.
Extent
  width : Number
[read-only] Distance between xmin and xmax.
Extent
  xmax : Number
Top-right x-coordinate of an extent envelope.
Extent
  xmin : Number
Bottom-left x-coordinate of an extent envelope.
Extent
  ymax : Number
Top-right y-coordinate of an extent envelope.
Extent
  ymin : Number
Bottom-left y-coordinate of an extent envelope.
Extent
Public Methods
 MethodDefined by
  
Extent(xmin:Number = 0, ymin:Number = 0, xmax:Number = 0, ymax:Number = 0, spatialReference:SpatialReference = null)
Creates a new Extent object.
Extent
  
Returns a new extent of the same size but re-centered on the specified location.
Extent
  
contains(point:MapPoint):Boolean
Checks if a point is contained in "this" extent.
Extent
  
containsExtent(env:Extent):Boolean
Checks if another extent is completely contained within "this" extent.
Extent
  
expand(factor:Number):Extent
Returns a new expanded extent.
Extent
  
Returns a new extent of the area that are in both extents.
Extent
  
intersects(geometry:Geometry):Boolean
Checks if the geometry in the argument intersects "this" extent.
Extent
  
offset(dx:Number, dy:Number):Extent
Returns a new extent with the given offset from "this" extent.
Extent
  
union(extent:Extent):Extent
Returns a new extent that covers both areas.
Extent
  
update(xmin:Number, ymin:Number, xmax:Number, ymax:Number, spatialReference:SpatialReference = null):void
Updates extent with new values.
Extent
Public Constants
 ConstantDefined by
 InheritedEXTENT : String = "esriGeometryEnvelope"
[static] An extent is defined by xmin, ymin, xmax and ymax.
Geometry
 InheritedMAPPOINT : String = "esriGeometryPoint"
[static] A MapPoint is a basic point with x (often longitude), y (often latitude) and an optional spatial reference.
Geometry
 InheritedMULTIPOINT : String = "esriGeometryMultipoint"
[static] A multipoint consists of one or more MapPoint(s).
Geometry
 InheritedPOLYGON : String = "esriGeometryPolygon"
[static] A polygon is a set of areas with three or more points.
Geometry
 InheritedPOLYLINE : String = "esriGeometryPolyline"
[static] A polyline is set of lines with two or more points.
Geometry
Property detail
centerproperty
center:MapPoint  [read-only]

Returns the centerpoint of the extent.

This property can be used as the source for data binding.

Implementation
    public function get center():MapPoint
extentproperty 
extent:Extent  [read-only]

The extent of this Extent.

This property can be used as the source for data binding.

Implementation
    public function get extent():Extent
heightproperty 
height:Number  [read-only]

Distance between ymin and ymax.

This property can be used as the source for data binding.

Implementation
    public function get height():Number
typeproperty 
type:String  [read-only]

The type of geometry is EXTENT.

This property can be used as the source for data binding.

Implementation
    public function get type():String
widthproperty 
width:Number  [read-only]

Distance between xmin and xmax.

This property can be used as the source for data binding.

Implementation
    public function get width():Number
xmaxproperty 
xmax:Number  [read-write]

Top-right x-coordinate of an extent envelope.

This property can be used as the source for data binding.

Implementation
    public function get xmax():Number
    public function set xmax(value:Number):void
xminproperty 
xmin:Number  [read-write]

Bottom-left x-coordinate of an extent envelope.

This property can be used as the source for data binding.

Implementation
    public function get xmin():Number
    public function set xmin(value:Number):void
ymaxproperty 
ymax:Number  [read-write]

Top-right y-coordinate of an extent envelope.

This property can be used as the source for data binding.

Implementation
    public function get ymax():Number
    public function set ymax(value:Number):void
yminproperty 
ymin:Number  [read-write]

Bottom-left y-coordinate of an extent envelope.

This property can be used as the source for data binding.

Implementation
    public function get ymin():Number
    public function set ymin(value:Number):void
Constructor detail
Extent()constructor
public function Extent(xmin:Number = 0, ymin:Number = 0, xmax:Number = 0, ymax:Number = 0, spatialReference:SpatialReference = null)

Creates a new Extent object.

Parameters
xmin:Number (default = 0) — Bottom-left x-coordinate of an extent envelope.
 
ymin:Number (default = 0) — Bottom-left y-coordinate of an extent envelope.
 
xmax:Number (default = 0) — Top-right x-coordinate of an extent envelope.
 
ymax:Number (default = 0) — Top-right y-coordinate of an extent envelope.
 
spatialReference:SpatialReference (default = null) — Spatial reference of the geometry.
Method detail
centerAt()method
public function centerAt(point:MapPoint):Extent

Returns a new extent of the same size but re-centered on the specified location.

Parameters
point:MapPoint — The point to center at.

Returns
Extent — A new extent is returned with the same width and height centered at the argument point.
contains()method 
public function contains(point:MapPoint):Boolean

Checks if a point is contained in "this" extent.

Parameters
point:MapPoint — The location to check for.

Returns
Boolean — True if the extent contains the point, false otherwise.

See also


Example
ActionScript to check if a point is inside the extent:
     if( extent.contains( MapPoint(graphic.geometry) ) ) 

containsExtent()method 
public function containsExtent(env:Extent):Boolean

Checks if another extent is completely contained within "this" extent.

Parameters
env:Extent — other extent.

Returns
Boolean — True if this extent contains the passed extent.
expand()method 
public function expand(factor:Number):Extent

Returns a new expanded extent. For example, a value of 1.5 will create an extent that is 50% bigger.

Parameters
factor:Number — The multiplier value.

Returns
Extent — A new expanded extent.
intersection()method 
public function intersection(extent:Extent):Extent

Returns a new extent of the area that are in both extents.

Parameters
extent:Extent — The minx, miny, maxx and maxy bounding box.

Returns
Extent — The intersecting extent or null if extents do not intersect.
intersects()method 
public function intersects(geometry:Geometry):Boolean

Checks if the geometry in the argument intersects "this" extent.

Note: as of version 1.3 this method accepts any geometry. Before it only accepted other extents.

Parameters
geometry:Geometry — The input geometry.

Returns
Boolean — true if intersects, false otherwise.
offset()method 
public function offset(dx:Number, dy:Number):Extent

Returns a new extent with the given offset from "this" extent. Units are in map units.

Parameters
dx:Number — The offset distance in map units for the x-coordinate.
 
dy:Number — The offset distance in map units for the y-coordinate.

Returns
Extent — A new offset extent.
union()method 
public function union(extent:Extent):Extent

Returns a new extent that covers both areas.

Parameters
extent:Extent — The minx, miny, maxx and maxy bounding box.

Returns
Extent — A new union extent.
update()method 
public function update(xmin:Number, ymin:Number, xmax:Number, ymax:Number, spatialReference:SpatialReference = null):void

Updates extent with new values.

Parameters
xmin:Number — The new minimum x-coordinate value.
 
ymin:Number — The new minimum y-coordinate value.
 
xmax:Number — The new maximum x-coordinate value.
 
ymax:Number — The new maximum y-coordinate value.
 
spatialReference:SpatialReference (default = null) — The new spatial reference.