Types
import type { ObjectId, HighlightTarget, SingleBandPixelHighlightTarget, XYBandPixelHighlightTarget, PixelHighlightTarget } from "@arcgis/core/views/types.js";
Since
ArcGIS Maps SDK for JavaScript 5.0

A module for importing types used in View modules.

Type definitions

ObjectId

Type definition

The object ID or the unique identifier string for a Graphic.

See also
Type
number | string

HighlightTarget

Type definition

The feature(s) to highlight when calling highlight() method on a LayerView instance. When passing a graphic or array of graphics, each feature must have a valid objectId.

See also

SingleBandPixelHighlightTarget

Type definition

The pixels in a single band to highlight when calling highlight() method on an ImageryLayerView instance.

pixelRanges

Property
Type
[ number, number ][]

An array of pixel value ranges to highlight. Each range is represented as a two-element array where the first element is the minimum value and the second element is the maximum value of the range.

bandId

Property
Type
number | undefined

The band ID to which the pixel ranges apply. If not specified, the first band (band 0) is used by default.

XYBandPixelHighlightTarget

Type definition

The pixels to highlight based on their values in two bands (an x-band and a y-band) when calling highlight() on an ImageryLayerView instance.

pixelRanges

Property
Type
Extent | Polygon

The pixel ranges to highlight based on their position in the band space with x-axis and y-axis representing corresponding pixel values for the two selected bands. This can be represented as an Extent or a Polygon.

xBandId

Property
Type
number

The band ID for the x-coordinate.

yBandId

Property
Type
number

The band ID for the y-coordinate.

PixelHighlightTarget

Type definition

The pixel value(s) to highlight when calling highlight() method on an ImageryLayerView instance.

TargetBase

Type definition

Target2D

Type definition
Supertypes
TargetBase

Target3D

Type definition

TargetOptionsBase

Type definition

scale

Property
Type
number | undefined

zoom

Property
Type
number | undefined

The final MapView.zoom/SceneView.zoom value to go to.

TargetOptions2DBase

Type definition
Supertypes
TargetOptionsBase

CenterOptions2D

Type definition
Supertypes
TargetOptions2DBase

center

Property
Type
number[] | Point | undefined

The MapView.center to go to.

TargetOptions2D

Type definition
Supertypes
TargetOptions2DBase

target

Property
Type
Target2D | undefined

The target of the animation.

TargetOptions3DBase

Type definition
Supertypes
TargetOptionsBase

CenterOptions3D

Type definition
Supertypes
TargetOptions3DBase

center

Property
Type
number[] | Point | undefined

The SceneView.center to go to.

TargetOptions3D

Type definition
Supertypes
TargetOptions3DBase

target

Property
Type
Target3D | undefined

The target of the animation.

GoToTarget2D

Type definition

The target location/viewpoint to animate to in the MapView.goTo() method. A two-element array of numbers represents the [x,y] coordinates to center the view on. When using an object for the target, use the properties in the table below.

See also

GoToTarget3D

Type definition

The target location/viewpoint to animate to in the SceneView.goTo() method. A two or three-element array of numbers represents the [x,y,z] coordinates to center the view on. When using an object for the target, use the properties in the table below.

See also

EasingFunction

Type definition

User provided easing function. The function receives a normalized time between 0 and 1 as input and should provide a transformed normalized time between 0 and 1 as output.

Parameters

ParameterTypeDescriptionRequired
t

The input time (from 0 to 1)

duration

The total duration (in milliseconds) of the animation. This may be used for heuristics on deciding what type of easing to perform.

Returns
number

a value between 0 and 1

Example
// Simple quadratic ease in function
function easeIn(t) {
return t * t;
}

AnimationMode

Type definition
Type
"always" | "auto"

GoToOptionsBase

Type definition
Supertypes
AbortOptions

animate

Property
Type
boolean | undefined

Indicates whether the transition to the new viewpoint is animated. If set to false, speedFactor, duration, maxDuration, and easing properties are ignored.

Starting at 4.30, the default behavior of goTo() follows the user preference for reduced motion. By default, goTo() will animate, but when the user expresses a preference for reduced motion, goTo() will navigate to the specified target without animation. It is possible to override the user's preference for reduced motion by configuring esriConfig.respectPrefersReducedMotion or on a per-call basis by specifying the animate property.

Default value
true

duration

Property
Type
number | null | undefined

Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration.

easing

Property
Type
EasingName | EasingFunction | undefined

The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: linear, cubic-in, cubic-out, cubic-in-out, expo-in, expo-out, expo-in-out, quad-in-out-coast, ease-in, ease-out, ease-in-out, as well as in-cubic, out-cubic, in-out-cubic, in-expo, out-expo, in-out-expo, and in-out-coast-quad. See easing functions and CSS easing functions for graphical representations of these functions.

By default, animations that are less than 1000 ms use the expo-out easing function; longer animations use the quad-in-out-coast easing function.

maxDuration

Property
Type
number | undefined

The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. If animationMode is set to "always", animations will be sped up to fit in this time. Otherwise, animations will not run if they exceed this time.

Default value
isMapView ? 4000 : 8000

speedFactor

Property
Type
number | undefined

Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly.

Default value
1

GoToOptions2D

Type definition

Animation options for the MapView.goTo() method. See properties below for object specifications.

Supertypes
GoToOptionsBase

animationMode

Property
Type
AnimationMode | undefined

The strategy for deciding whether the transition will animate when animate is not false, and the user has not expressed a preference for reduced motion. If set to "auto", the view will automatically decide whether or not to animate, depending on an internal heuristic that considers time, distance, and the maxDuration option. If set to "always", the transition will always animate.

Default value
auto

pickClosestTarget

Property
Type
boolean | undefined

Indicates if the target geometry is normalized based on the MapView.center of the view. When true, if the user pans more than 270 degrees east, the goTo() method will navigate the view 90 degrees west when panning to the designated target. This property is only honored if MapView.spatialReference.isWrappable is true.

Default value
true

GoToOptions3D

Type definition

Animation options for the SceneView.goTo() method. See properties below for parameter specifications.

Supertypes
GoToOptionsBase

ToScreenOptions2D

Type definition

Options for the MapView.toScreen() method. See properties below for object specifications.

pickClosestTarget

Property
Type
boolean | undefined

Indicates if the point will be normalized based on the MapView.center of the view. When true, if the point is not in view, the result of toScreen() will not exceed the pixel equivalent of 180 degrees east or west of the center of the view. This property is only honored if MapView.spatialReference.isWrappable is true.

Default value
true

FetchPopupFeaturesResult

Type definition

The resulting features returned from the Popup.fetchFeatures() method.

allGraphicsPromise

Property
Type
Promise<Graphic[]>

A promise containing graphics from the selected location. This can be a combination of graphics derived from a LayerView, and/or graphics that reside directly on the view, ie. View.graphics.

pendingFeatures

Property
Type
Promise<Graphic[]>[]

An array of promises containing graphics from the selected location. Each promise resolves to an array of graphics.

location

Property
Type
Point | null | undefined

The resulting location of the MapView.hitTest() or SceneView.hitTest()'s' hitTest.

ViewHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the result returned in ViewHitTestResult of the MapView.hitTest() method.

GraphicHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the graphic hit result returned in ViewHitTestResult of the MapView.hitTest() method.

type

Property
Type
"graphic"

mapPoint

Property
Type
Point | null | undefined

The point geometry in the spatial reference of the view corresponding with the input screen coordinates.

graphic

Property
Type
Graphic

A graphic present in the view that intersects the input screen coordinates. If a label intersects the input screen coordinates (since 4.11), the corresponding graphic is returned. If the graphic comes from a layer with an applied Renderer, then the symbol property will be empty. Other properties may be empty based on the context in which the graphic is fetched.

Some layers do not have a graphic.geometry (for example: VoxelLayer). The graphic.attributes only includes attributes which are loaded by the client, so it can be a subset of all attributes. FeatureLayer.outFields with ["*"] can be used to force all attributes to be present.

The graphic.symbol exists only for graphics coming from GraphicsLayer or view.graphics, but it is possible to compute the displayed symbology with getDisplayedSymbol.

If the result comes from a VectorTileLayer, result graphics contain attributes of style layers. The graphic's origin property contains layerId and layerIndex information, corresponding to the unique id and index of the style layer in the vector tile style. Spatial information about the actual feature represented in the style layer is returned only if the style layer is a symbol layer; otherwise, the graphic's geometry is null.

layer

Property
Type
Layer

The layer that contains the feature/graphic.

MediaHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the media hit results returned from MediaLayer in ViewHitTestResult of the MapView.hitTest() method.

type

Property
Type
"media"

mapPoint

Property
Type
Point | null | undefined

The point geometry in the spatial reference of the view corresponding with the input screen coordinates.

layer

Property
Type
MediaLayer

The media layer that contains the element.

element

Property
Type
MediaElement

An element representing a media element in MediaLayer.source that intersects the input screen coordinates.

sourcePoint

Property
Type
ScreenPoint | null | undefined

An object representing a point on the element. The origin (0, 0) corresponds to the top-left corner of the element.

RouteHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the route hit results returned from RouteLayer in ViewHitTestResult of the MapView.hitTest() method.

type

Property
Type
"route"

layer

Property
Type
RouteLayer

The route layer that contains the element.

mapPoint

Property
Type
Point

The point geometry in the spatial reference of the view corresponding with the input screen coordinates.

networkFeature

Property
Type
NetworkFeature

The route hit test will contain all intersecting network elements which, includes one of the following: DirectionLine, DirectionPoint, PointBarrier, PolylineBarrier, PolygonBarrier, Stop, or RouteInfo.

ViewHitTestResult

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the result of the MapView.hitTest() method.

screenPoint

Property
Type
ScreenPoint

The screen coordinates (or native mouse event) of the click on the view.

results

Property
Type
ViewHit[]

An array of result objects returned from the MapView.hitTest(). Results are returned when the location of the input screen coordinates intersects a Graphic, media element, or RouteLayer in the view.

Screenshot

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.9

Object returned when MapView.takeScreenshot() or SceneView.takeScreenshot() promise resolves:

dataUrl

Property
Type
string

A data url representing the screenshot.

data

Property
Type
ImageData

The raw RGBA image data.

EncodingSettings

Type definition

Encoding settings used when calling MapView.takeScreenshot() or SceneView.takeScreenshot() methods.

format

Property
Type
"png" | "jpeg" | "jpg"

The format of the encoded image data. Defaults to png.

Default value
png

quality

Property
Type
number

The quality (between 0 and 100) of the jpg encoded image data. Defaults to 90.

Default value
98

SettingsCommon

Type definition

Common settings used when calling MapView.takeScreenshot() or SceneView.takeScreenshot() methods.

Supertypes
EncodingSettings

ignoreBackground

Property
Type
boolean | undefined

Indicates whether to ignore the background color set in the initial view properties of the web map.

Default value
false

Rect

Type definition

Specifies whether to take a screenshot of a specific area of the view.

See also

x

Property
Type
number

The x coordinate of the area.

y

Property
Type
number

The y coordinate of the area.

width

Property
Type
number

The width of the area.

height

Property
Type
number

The height of the area.

UserSettings

Type definition

Param settings used to capture screenshots an area by calling MapView.takeScreenshot() or SceneView.takeScreenshot() methods. Width and height indicate the target image's width and height.

Supertypes
SettingsCommon

width

Property
Type
number

The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area.

height

Property
Type
number

The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area.

area

Property
Type
Rect

Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see MapView.padding/SceneView.padding) and will be clipped to the view size. Defaults to the whole view (padding excluded).

layers

Property
Type
ReadonlyArrayOrCollection<Layer> | undefined

An optional list of layers to be included in the screenshot.

ignorePadding

Property
Type
boolean

Indicates whether view padding should be ignored. Set this property to true to allow padded areas to be included in the screenshot.

Default value
false

HitExtension

Type definition
Type parameters
<T>

Type extension that adds distance property to hit test results.

Supertypes
T

distance

Property
Type
number

The distance from the camera position to the point geometry hit on this graphic. In global scenes the distance will be in meters while in local scenes the distance will be in the unit of the spatial reference of the view.

SceneViewHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the result returned in SceneViewHitTestResult of the SceneView.hitTest() method.

SceneViewGraphicHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the graphic hit result returned in SceneViewHitTestResult of the SceneView.hitTest() method.

Supertypes
HitExtension<GraphicHit>

SceneViewMediaHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the media hit results returned from MediaLayer in SceneViewHitTestResult of the SceneView.hitTest() method.

Supertypes
HitExtension<MediaHit>

SceneViewRouteHit

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the route hit results returned from RouteLayer in SceneViewHitTestResult of the SceneView.hitTest() method.

Supertypes
HitExtension<RouteHit>

SceneViewHitTestResult

Type definition
Since
ArcGIS Maps SDK for JavaScript 4.24

Object specification for the result of the SceneView.hitTest() method.

Supertypes
ViewHitTestResult

results

Property
Type
SceneViewHit[]

An array of result objects returned from the SceneView.hitTest() when the location of the input screen coordinates intersect features in the view.

ground

Property
Type
SceneViewHitTestResultGround

Ground intersection result. The ground hit result will always be returned, even if the ground was excluded from the SceneView.hitTest().

SceneViewHitTestResultGround

Type definition

mapPoint

Property
Type
Point

The point at which the ground was hit while performing the hitTest. This may be null when the ground was not hit at all (for example by clicking on the sky).

distance

Property
Type
number

The distance from camera position to the ground hit. The distance will be 0 if the ground was not hit at all. In global scenes the distance will be in meters while in local scenes the distance will be in the unit of the spatial reference of the view.

HitTestItem

Type definition

A layer, graphic, or collection of layers or graphics to be used in the MapView's hitTest filter options.

See also

HitTestOptionsItem

Type definition

A layer, graphic, or collection of layers or graphics to be used in the MapView's hitTest filter options.

Type
HitTestItem | Iterable<HitTestItem | Iterable<HitTestItem>>

HitTestOptions

Type definition

Options for specifying which HitTestItem are included or excluded when calling the MapView’s hitTest method.

include

Property
Type
HitTestOptionsItem | null | undefined

A list of layers and graphics to include in the hitTest. All layers and graphics will be included if include is not specified.

exclude

Property
Type
HitTestOptionsItem | null | undefined

A list of layers and graphics to exclude from the hitTest. No layers or graphics will be excluded if exclude is not specified.

HitTestItem3D

Type definition

Intersection test options. By default the Map.ground is excluded if its opacity is smaller than one.

HitTestOptions3DItem

Type definition

A layer, graphic, or collection of layers or graphics to be used in the SceneView's hitTest filter options.

Type
HitTestItem3D | Iterable<HitTestItem3D | Iterable<HitTestItem3D>>

HitTestOptions3D

Type definition

Options for specifying which HitTestItem3D are included or excluded when calling the SceneView's hitTest method.

include

Property
Type
HitTestOptions3DItem | null | undefined

A list of layers and graphics to include for intersection testing. All layers and graphics will be included if include is not specified.

exclude

Property
Type
HitTestOptions3DItem | null | undefined

A list of layers and graphics to exclude for intersection testing. No layers or graphics will be excluded if exclude is not specified.

Breakpoints

Type definition

A convenience property used for defining the breakpoints on the height and width of the view. The sizes specified here determine the values of the widthBreakpoint and heightBreakpoint properties depending on the view's size.

Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple @media calls. Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the widthBreakpoint or heightBreakpoint properties of the view.

Please refer to the styling guide for additional information on working with this.

See also

xsmall

Property
Type
number

Sets the xsmall breakpoint in pixels used by widthBreakpoint and heightBreakpoint. If the view's height or width is smaller than this value, then the value of widthBreakpoint or heightBreakpoint will be xsmall.

Default value
544

small

Property
Type
number

Sets the small breakpoint in pixels used by widthBreakpoint and heightBreakpoint. If the view's height or width is between this value and the value of the xsmall property, then the value of widthBreakpoint or heightBreakpoint will be small.

Default value
768

medium

Property
Type
number

Sets the medium breakpoint in pixels used by widthBreakpoint and heightBreakpoint. If the view's height or width is between this value and the value of the small property, then the value of widthBreakpoint or heightBreakpoint will be medium.

Default value
992

large

Property
Type
number

Sets the large breakpoint in pixels used by widthBreakpoint and heightBreakpoint. If the view's height or width is between this value and the value of the medium property, then the value of widthBreakpoint or heightBreakpoint will be large. widthBreakpoint and heightBreakpoint. If the view's height or width is greater than the value of the large property, then the value of widthBreakpoint or heightBreakpoint will be xlarge.

Default value
1200

BreakpointOrientation

Type definition

A convenience property indicating the view's orientation. See the table below for a list of possible values.

Please refer to the styling guide for additional information on working with this.

Possible ValueDescription
landscapeThe width of the view is greater than its height.
portraitThe width of the view is equal to or smaller than its height.
Type
"landscape" | "portrait"

BreakpointSize

Type definition

Indicates the general size of the view's width or height. This value is determined based on where the view's width or height falls in the ranges defined in the breakpoints property. See the table below for a list of possible values. Use the breakpoints property to override the default thresholds.

Possible ValueDescriptionDefault thresholds (pixels)
xsmallThe width or height of the view is smaller than the value set in the xsmall breakpoint.< 545
smallThe width or height of the view is between the values set in the xsmall and small breakpoints.545 - 768
mediumThe width or height of the view is between the values set in the small and medium breakpoints.769 - 992
largeThe width or height of the view is between the values set in the medium and large breakpoints.993 - 1200
xlargeThe width or height of the view is larger than the value set in the large breakpoint.> 1200
See also
Type
"xsmall" | "small" | "medium" | "large" | "xlarge"

AnalysisViewCreateEvent

Type definition

analysis

Property
Type
Analysis

The analysis for which the analysisView was created.

analysisView

Property
Type
AnalysisViewUnion

The analysis view that was created.

AnalysisViewCreateErrorEvent

Type definition

analysis

Property
Type
Analysis

The analysis for which the analysisView was created.

error

Property
Type
Error

An error object describing why the analysis view could not be created.

AnalysisViewDestroyEvent

Type definition

analysis

Property
Type
Analysis

The analysis whose analysis view was destroyed.

analysisView

Property
Type
AnalysisViewUnion

The analysis view that was destroyed.

AnalysisViewEvents

Type definition

analysis-view-create

Property
Type
AnalysisViewCreateEvent

Fires when the view for an Analysis is created.

See also

analysis-view-create-error

Property
Type
AnalysisViewCreateErrorEvent

Fires when an error occurs during the creation of an Analysis after an analysis is added to the view.

See also

analysis-view-destroy

Property
Type
AnalysisViewDestroyEvent

Fires after an analysis view is destroyed.

SceneViewEventTypes

Type definition