import Extent from "@arcgis/core/geometry/Extent.js";const Extent = await $arcgis.import("@arcgis/core/geometry/Extent.js");- Since
- ArcGIS Maps SDK for JavaScript 4.0
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
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
hasZ
- Type
- boolean
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.
zmax
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.
zmin
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.
Methods
| Method | Signature | Class |
|---|---|---|
fromJSON inherited static | fromJSON(json: any): any | |
centerAt(point: Point): this | | |
clone(): Extent | | |
contains(geometry: Point | Extent): boolean | | |
equals(extent: Extent | null | undefined): boolean | | |
expand(factor: number): this | | |
intersection(extent: Extent | null | undefined): this | null | undefined | | |
intersects(geometry: GeometryUnion | null | undefined): boolean | | |
normalize(): Extent[] | | |
offset(dx: number, dy: number, dz?: number): this | | |
toJSON inherited | toJSON(): any | |
union(extent: Extent): this | |
fromJSON
- Signature
-
fromJSON (json: any): any
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.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A 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. | |
- Returns
- any
Returns a new instance of this class.
clone
- Signature
-
clone (): Extent
Creates a deep clone of Extent object.
- Returns
- Extent
A new instance of a Extent object equal to the object used to call
.clone().
expand
- Signature
-
expand (factor: number): this
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.
intersection
- Signature
-
intersection (extent: Extent | null | undefined): this | null | undefined
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.
intersects
- Signature
-
intersects (geometry: GeometryUnion | null | undefined): boolean
Tests to validate if the input geometry intersects the extent and returns a Boolean value.
normalize
- Signature
-
normalize (): 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.
This method modifies the extent geometry in-place. You should clone() the extent object before calling this method where appropriate.
- Returns
- Extent[]
The normalized Extent(s).
offset
- Signature
-
offset (dx: number, dy: number, dz?: number): this
Modifies the extent geometry in-place with X and Y offsets in map units. You should clone() the extent object before calling this method where appropriate.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.
union
- Signature
-
union (extent: Extent): this
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.