Packagecom.esri.ags.geometry
Classpublic class Extent
InheritanceExtent Inheritance Geometry Inheritance Object
Implements flash.events.IEventDispatcher
Subclasses WebMercatorExtent

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

Default MXML PropertyspatialReference

View the examples

See also

Concepts - Using Extent


Public Properties
 PropertyDefined By
  center : MapPoint
[read-only] Returns the centerpoint of the extent.
Extent
  extent : Extent
[override] [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
[override] [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(geometry:Geometry):Boolean
Checks if a geometry is contained in "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
  
Returns a new Polygon with one ring containing points equivalent to the coordinates of this 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.


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

The extent of this Extent.


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

Distance between ymin and ymax.


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

The type of geometry is EXTENT.


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

Distance between xmin and xmax.


Implementation
    public function get width():Number
xmaxproperty 
xmax:Number

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

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

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

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(geometry:Geometry):Boolean

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

Parameters

geometry:Geometry — The input geometry.

Returns
Boolean — Returns true if "this" extent contains the geometry, false otherwise.

See also


Example
ActionScript to check if a geometry is inside the extent:
     if (extent.contains(graphic.geometry))
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 xmin, ymin, xmax and ymax bounding box.

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

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

Parameters

geometry:Geometry — The input geometry.

Returns
Boolean — Returns true if input geometries intersect "this" extent, 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.
toPolygon()method 
public function toPolygon():Polygon

Since : ArcGIS API for Flex 2.3

Returns a new Polygon with one ring containing points equivalent to the coordinates of this extent.

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

Returns a new extent that covers both areas.

Parameters

extent:Extent — The xmin, ymin, xmax and ymax 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.

Examples
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}"/>