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
The object ID or the unique identifier string for a Graphic.
- See also
HighlightTarget
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
- Type
- Graphic | Graphic[] | Collection<Graphic>
SingleBandPixelHighlightTarget
The pixels in a single band to highlight when calling highlight() method on an ImageryLayerView instance.
XYBandPixelHighlightTarget
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.
PixelHighlightTarget
The pixel value(s) to highlight when calling highlight() method on an ImageryLayerView instance.
TargetBase
- Type
- number[] | GeometryUnion | GeometryUnion[] | Graphic | Graphic[] | Viewpoint
GoToTarget2D
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
- Type
- TargetOptions2D | CenterOptions2D | Target2D
GoToTarget3D
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
- Type
- TargetOptions3D | CenterOptions3D | Target3D
EasingFunction
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
- Returns
- number
a value between 0 and 1
- Example
- // Simple quadratic ease in functionfunction easeIn(t) {return t * t;}
GoToOptionsBase
- Supertypes
- AbortOptions
animate
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
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
- 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
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
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
Animation options for the MapView.goTo() method. See properties below for object specifications.
- Supertypes
- GoToOptionsBase
animationMode
- 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
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
Animation options for the SceneView.goTo() method. See properties below for parameter specifications.
- Supertypes
- GoToOptionsBase
ToScreenOptions2D
Options for the MapView.toScreen() method. See properties below for object specifications.
pickClosestTarget
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
The resulting features returned from the Popup.fetchFeatures() method.
location
The resulting location of the MapView.hitTest() or SceneView.hitTest()'s' hitTest.
ViewHit
- Since
- ArcGIS Maps SDK for JavaScript 4.24
Object specification for the result returned in ViewHitTestResult of the MapView.hitTest() method.
- Type
- GraphicHit | MediaHit | RouteHit
GraphicHit
- Since
- ArcGIS Maps SDK for JavaScript 4.24
Object specification for the graphic hit result returned in ViewHitTestResult of the MapView.hitTest() method.
graphic
- 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.
MediaHit
- 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.
element
- Type
- MediaElement
An element representing a media element in MediaLayer.source that intersects the input screen coordinates.
sourcePoint
- 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
- 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.
mapPoint
- Type
- Point
The point geometry in the spatial reference of the view corresponding with the input screen coordinates.
networkFeature
- 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
- Since
- ArcGIS Maps SDK for JavaScript 4.24
Object specification for the result of the MapView.hitTest() method.
screenPoint
- Type
- ScreenPoint
The screen coordinates (or native mouse event) of the click on the view.
results
- 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
- Since
- ArcGIS Maps SDK for JavaScript 4.9
Object returned when MapView.takeScreenshot() or SceneView.takeScreenshot() promise resolves:
EncodingSettings
Encoding settings used when calling MapView.takeScreenshot() or SceneView.takeScreenshot() methods.
quality
- Type
- number
The quality (between 0 and 100) of the jpg encoded image data. Defaults to 90.
- Default value
- 98
SettingsCommon
Common settings used when calling MapView.takeScreenshot() or SceneView.takeScreenshot() methods.
- Supertypes
- EncodingSettings
ignoreBackground
Indicates whether to ignore the background color set in the initial view properties of the web map.
- Default value
- false
Rect
Specifies whether to take a screenshot of a specific area of the view.
- See also
UserSettings
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
- 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
- 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
- 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
- Type
- ReadonlyArrayOrCollection<Layer> | undefined
An optional list of layers to be included in the screenshot.
ignorePadding
- 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 parameters
- <T>
Type extension that adds distance property to hit test results.
- Supertypes
- T
distance
- 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
- Since
- ArcGIS Maps SDK for JavaScript 4.24
Object specification for the result returned in SceneViewHitTestResult of the SceneView.hitTest() method.
SceneViewGraphicHit
- 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
- 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
- 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
- Since
- ArcGIS Maps SDK for JavaScript 4.24
Object specification for the result of the SceneView.hitTest() method.
- Supertypes
- ViewHitTestResult
results
- 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
Ground intersection result. The ground hit result will always be returned, even if the ground was excluded from the SceneView.hitTest().
SceneViewHitTestResultGround
mapPoint
- 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
- 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
A layer, graphic, or collection of layers or graphics to be used in the MapView's hitTest filter options.
- See also
- Type
- Layer | SubtypeSublayer | Graphic
HitTestOptionsItem
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
Options for specifying which HitTestItem are included or excluded when calling the MapView’s hitTest method.
include
- 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
- 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
Intersection test options. By default the Map.ground is excluded if its opacity is smaller than one.
- Type
- HitTestItem | Ground | BuildingSublayer
HitTestOptions3DItem
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
Options for specifying which HitTestItem3D are included or excluded when calling the SceneView's hitTest method.
include
- 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
- 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
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
- 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
- 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
- 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
- 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
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 Value | Description |
|---|---|
| landscape | The width of the view is greater than its height. |
| portrait | The width of the view is equal to or smaller than its height. |
- Type
- "landscape" | "portrait"
BreakpointSize
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 Value | Description | Default thresholds (pixels) |
|---|---|---|
| xsmall | The width or height of the view is smaller than the value set in the xsmall breakpoint. | < 545 |
| small | The width or height of the view is between the values set in the xsmall and small breakpoints. | 545 - 768 |
| medium | The width or height of the view is between the values set in the small and medium breakpoints. | 769 - 992 |
| large | The width or height of the view is between the values set in the medium and large breakpoints. | 993 - 1200 |
| xlarge | The 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"
AnalysisViewEvents
analysis-view-create
Fires when the view for an Analysis is created.
analysis-view-create-error
Fires when an error occurs during the creation of an Analysis after an analysis is added to the view.
analysis-view-destroy
Fires after an analysis view is destroyed.