▾
import type { DOMContainer } from "@arcgis/core/views/DOMContainer.js";- Since
- ArcGIS Maps SDK for JavaScript 4.0
DOMContainer is a mixin that adds properties and methods to View classes for managing and interacting with DOM containers.
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| readonly | | |
| | ||
| | ||
| readonly | | |
| readonly | | |
| | ||
| | ||
| readonly | | |
| readonly | | |
| readonly | | |
| readonly | | |
| deprecated | | |
| readonly | |
aria
- Type
- DOMContainerAria
- Since
- ArcGIS Maps SDK for JavaScript 4.34
The ARIA attributes for the view container.
attributionHeight
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The height of the attribution in pixels. The value is practical to adjust the bottom padding of other UI elements. The value changes when the attribution is expanded or collapsed.
attributionMode
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The light or dark mode used to display the attribution. By default, the mode is inherited from the Calcite's mode. You can override the value to style the attribution alongside the map or scene content.
container
- Type
- HTMLDivElement | null | undefined
The id or node representing the DOM element containing the view. This is typically set in the view's constructor.
- Examples
- // Sets container to the DOM idlet view = new MapView({container: "viewDiv" // ID of the HTML element that holds the view});// Sets container to the nodelet viewNode = document.getElementById("viewDiv");let view = new SceneView({container: viewNode});
focused
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.7
Indicates if the browser focus is on the view.
focusRegion
- Type
- ScreenRect | null
- Since
- ArcGIS Maps SDK for JavaScript 5.2
The screen rectangle of the active focus region, or null when focusRegionVisible is false.
This screen rectangle represents the area of the view that is currently in focus and can be used with methods that require a screen rectangle as input, such as hitTest().
| Action | Keyboard Shortcut / Property |
|---|---|
| Enable or disable focus region | When focusRegionShortcutEnabled is true, use the Shift + Alt/Option + O keyboard shortcut while the view is in focus. Alternatively, set focusRegionVisible to true or false. |
| Resize focus region | Use the Shift + Alt/Option + Up/Down arrow keys while the focus region is enabled. |
To know when this focus region is selected, listen for the focus-region-select event.
focusRegionShortcutEnabled
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 5.2
Enables the Shift + Alt/Option + O keyboard shortcut for showing the focusRegion. Applications should enable this only when handling custom selection of the focus region with the focus-region-select event. When false, the shortcut does not change the focusRegionVisible property.
- Default value
- false
focusRegionVisible
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 5.2
Indicates whether the focusRegion is visible. Set this property to true to show the centered focus region, or false to hide it.
When focusRegionShortcutEnabled is true, visibility can also be toggled by pressing the Shift + Alt/Option + O keyboard shortcut when the view is in focus.
- See also
- Default value
- false
height
- Type
- number
The height of the view in pixels read from the view container element.
The view container needs to have a height greater than 0 to be displayed.
- Default value
- 0
resizing
- Type
- boolean
Indicates whether the view is being resized.
- Default value
- false
suspended
- Type
- boolean
Indicates if the view is visible on the page. When true, the view is not visible and it stops rendering and updating data.
Set to true when one of the following conditions are met:
- if the view does not have a container,
- if the view's height or width equal to 0,
- if the view container's css style
displayis set tonone(display:none).
When the view container's css style visibility is set to hidden, this property is set to false, and
the view is hidden but it stills renders and updates data.
- Default value
- true
ui
- Type
- DefaultUI
Exposes the default widgets available in the view and allows you to toggle them on and off. See DefaultUI for more details.
- Examples
- let toggle = new BasemapToggle({view: view,nextBasemap: "hybrid"});// Adds an instance of BasemapToggle widget to the// top right of the view.view.ui.add(toggle, "top-right");// Moves the zoom and BasemapToggle widgets to the// bottom left of the view.view.ui.move([ "zoom", toggle ], "bottom-left");// Removes all the widgets from the bottom left of the viewview.ui.empty("bottom-left");// Removes the compass widget from the viewview.ui.remove("compass");// Removes all default UI components, except Attribution.// Passing an empty array will remove all components.view.ui.components = [ "attribution" ];
width
- Type
- number
The width of the view in pixels read from the view container element.
The view container needs to have a width greater than 0 to be displayed.
- Default value
- 0
Methods
Type definitions
DOMContainerAria
The ARIA attributes for the view container.
describedByElements
- Type
- HTMLElement[] | undefined
The array of HTML elements that describe the view container.
labelledByElements
- Type
- HTMLElement[] | undefined
The array of HTML elements that label the view container.