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
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.
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.