require(["esri/geometry/Extent"], (Extent) => { /* code goes here */ });
import Extent from "@arcgis/core/geometry/Extent.js";
esri/geometry/Extent
The minimum and maximum X and Y coordinates of a bounding box. Extent is used to describe the visible portion of a MapView. When working in a SceneView, Camera is used to define the visible part of the map within the view.
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
The cache is used to store values computed from geometries that need to be cleared or recomputed upon mutation. | Geometry | ||
The center point of the extent in map units. | Extent | ||
The name of the class. | Accessor | ||
The extent of the geometry. | Geometry | ||
Indicates if the geometry has M values. | Extent | ||
Indicates if the geometry has z-values (elevation). | Extent | ||
The height of the extent in map units (the distance between ymin and ymax). | Extent | ||
The maximum possible | Extent | ||
The minimum possible | Extent | ||
The spatial reference of the geometry. | Geometry | ||
For Extent the type is always "extent". | Extent | ||
The width of the extent in map units (the distance between xmin and xmax). | Extent | ||
The maximum X-coordinate of an extent envelope. | Extent | ||
The minimum X-coordinate of an extent envelope. | Extent | ||
The maximum Y-coordinate of an extent envelope. | Extent | ||
The minimum Y-coordinate of an extent envelope. | Extent | ||
The maximum possible | Extent | ||
The minimum possible | Extent |
Property Details
-
center
center Pointreadonly
-
The center point of the extent in map units.
-
hasM
hasM Booleanreadonly
-
Indicates if the geometry has M values.
-
hasZ
hasZ Booleanreadonly
-
Indicates if the geometry has z-values (elevation).
Z-values defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service.
-
height
height Numberreadonly
-
-
mmax
mmax Number
-
The maximum possible
m
value in an extent envelope.- Default Value:undefined
-
mmin
mmin Number
-
The minimum possible
m
value of an extent envelope.- Default Value:undefined
-
spatialReference
InheritedPropertyspatialReference SpatialReferenceautocast
Inherited from Geometry -
The spatial reference of the geometry.
- Default Value:SpatialReference.WGS84 // wkid: 4326
-
width
width Numberreadonly
-
-
xmax
xmax Number
-
The maximum X-coordinate of an extent envelope.
- Default Value:0
-
xmin
xmin Number
-
The minimum X-coordinate of an extent envelope.
- Default Value:0
-
ymax
ymax Number
-
The maximum Y-coordinate of an extent envelope.
- Default Value:0
-
ymin
ymin Number
-
The minimum Y-coordinate of an extent envelope.
- Default Value:0
-
zmax
zmax Number
-
The maximum possible
z
, or elevation, value in an extent envelope.Z-values defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service.
- Default Value:undefined
-
zmin
zmin Number
-
The minimum possible
z
, or elevation, value of an extent envelope.Z-values defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service.
- Default Value:undefined
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Centers the extent to the specified Point. | Extent | ||
Creates a deep clone of Extent object. | Extent | ||
Checks if the input geometry is contained within the extent. | Extent | ||
Indicates if the input extent is equal to the testing extent. | Extent | ||
Expands the extent by the given factor. | Extent | ||
* | Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. | Geometry | |
Returns true if a named group of handles exist. | Accessor | ||
Shrinks the original extent to the intersection with the input extent. | Extent | ||
Tests to validate if the input geometry intersects the extent and returns a Boolean value. | Extent | ||
Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the International Dateline. | Extent | ||
Modifies the extent geometry in-place with X and Y offsets in map units. | Extent | ||
Removes a group of handles owned by the object. | Accessor | ||
Converts an instance of this class to its ArcGIS portal JSON representation. | Geometry | ||
Expands the original extent to include the extent of the input Extent. | Extent |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
expand
expand(factor){Extent}
-
Expands the extent by the given factor. For example, a value of 1.5 will expand the extent to be 50 percent larger than the original extent. This method modifies the extent geometry in-place. You should clone the extent object before calling this method where appropriate.
Parameterfactor NumberThe multiplier value.
ReturnsType Description Extent Returns the expanded extent.
-
Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameterjson ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
ReturnsType Description * Returns a new instance of this class.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
intersection
intersection(extent){Extent}
-
Shrinks the original extent to the intersection with the input extent.
This method modifies the extent geometry in-place. You should clone the extent object before calling this method where appropriate. If the original extent and the input extent have no intersection, the extent is not modified and null is returned.
Parameterextent ExtentThe input extent to intersect.
ReturnsType Description Extent The intersection of the input Extent with the original Extent or null.
-
Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the International Dateline.
This method modifies the extent geometry in-place. You should clone the extent object before calling this method where appropriate.
Returns
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
-
toJSON
InheritedMethodtoJSON(){Object}
Inherited from Geometry -
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
ReturnsType Description Object The ArcGIS portal JSON representation of an instance of this class.
-
union
union(extent){Extent}
-
Expands the original extent to include the extent of the input Extent. This method modifies the extent geometry in-place. You should clone the extent object before calling this method where appropriate.
Parameterextent ExtentThe input extent to union.
ReturnsType Description Extent The union of the input Extent with the original Extent.