Skip to content
Types
import type { DOMContainer } from "@arcgis/core/views/DOMContainer.js";
Subclasses:
View2D, SceneView, VideoView
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

PropertyTypeClass
"dark" | "light" | null | undefined
focused
readonly
height
readonly
resizing
readonly
size
readonly
[ number, number ]
suspended
readonly
ui
width
readonly

aria

Property
Type
DOMContainerAria
Since
ArcGIS Maps SDK for JavaScript 4.34

The ARIA attributes for the view container.

See also

attributionHeight

readonly Property
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

Property
Type
"dark" | "light" | null | undefined
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

autocast Property
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 id
let view = new MapView({
container: "viewDiv" // ID of the HTML element that holds the view
});
// Sets container to the node
let viewNode = document.getElementById("viewDiv");
let view = new SceneView({
container: viewNode
});

focused

readonly Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 4.7

Indicates if the browser focus is on the view.

height

readonly Property
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

readonly Property
Type
boolean

Indicates whether the view is being resized.

Default value
false

size

readonly Property
Type
[ number, number ]

An array containing the width and height of the view in pixels, e.g. [width, height].

suspended

readonly Property
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 display is set to none (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

autocast Property
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 view
view.ui.empty("bottom-left");
// Removes the compass widget from the view
view.ui.remove("compass");
// Removes all default UI components, except Attribution.
// Passing an empty array will remove all components.
view.ui.components = [ "attribution" ];

width

readonly Property
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

MethodSignatureClass
focus(): void

focus

Method
Signature
focus (): void
Since
ArcGIS Maps SDK for JavaScript 4.5

Sets the focus on the view.

Returns
void

Type definitions

DOMContainerAria

Type definition

The ARIA attributes for the view container.

describedByElements

Property
Type
HTMLElement[] | undefined

The array of HTML elements that describe the view container.

description

Property
Type
string | undefined

The aria-description of the view container.

label

Property
Type
string | undefined

The aria-label of the view container.

labelledByElements

Property
Type
HTMLElement[] | undefined

The array of HTML elements that label the view container.