import "@arcgis/map-components/components/arcgis-scene";The ArcGIS Scene component is used to add 3D maps to web applications. For 2D maps, use the ArcGIS Map component.
The Scene component creates a SceneView and loads a WebScene item from either ArcGIS Online or ArcGIS Enterprise portal.
<arcgis-scene item-id="e2da7564e4f24eaaa918ffd70378056a"></arcgis-scene>Alternatively, the Scene component can be initialized without a WebScene item:
<arcgis-scene
 basemap="satellite"
 ground="world-elevation"
 camera-position="12.3808, 46.3959, 4400"
 camera-tilt="75"
 camera-heading="300">
</arcgis-scene>Further components can be added and connected to the Scene component:
<arcgis-scene item-id="e2da7564e4f24eaaa918ffd70378056a">
  <arcgis-layer-list slot="bottom-right"></arcgis-layer-list>
</arcgis-scene>The Scene component can be customized further using any of the core API functionalities of the ArcGIS Maps SDK for JavaScript.
const viewElement = document.querySelector("arcgis-scene");
await viewElement.viewOnReady();
// The view is now ready to be used.
const layer = new GraphicsLayer({ title: "My layer"});
viewElement.map.add(layer);See also
Demo
Properties
allLayerViews
allLayerViews: ReadonlyCollection<LayerView>Collection containing a flat list of all the created LayerViews related to the basemap, operational layers, and group layers in this view.
alphaCompositingEnabled
alphaCompositingEnabled: booleanAllows the view to be partially or fully transparent when composited with the webpage elements behind it.
- Attribute
 - alpha-compositing-enabled
 - Default value
 - false
 
aria
aria: DOMContainerAriaThe ARIA attributes for the view container. Provides accessibility information to assistive technologies such as screen readers. Supports the following properties: label, description, describedByElements, and labelledByElements.
autoDestroyDisabled
autoDestroyDisabled: booleanIf true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy method when you are done to prevent memory leaks.
- Attribute
 - auto-destroy-disabled
 - Default value
 - false
 
basemap
basemap: Basemap | stringSpecifies a basemap for the map. The basemap is a set of layers that give geographic context to the view and the other operational layers in the map. It can either be set using a basemap ID string (see values), Basemap or BasemapStyle.
- Attribute
 - basemap
 
basemapView
basemapView: BasemapViewRepresents the view for a single basemap after it has been added to the map.
camera
camera: CameraThe camera allows to set the observation point from which the visible portion (or perspective) of the view is determined. When set in the constructor, this property overrides the center, extent, scale, viewpoint, and zoom properties.
Setting the camera immediately changes the current view. For animating the view, see this component's goTo() method.
cameraFov
cameraFov: numberThe diagonal field of view (fov) angle for the camera. The range of angles must be between 1 and 170 degrees.
Setting the camera fov immediately changes the current view. For animating the view, see this component's goTo() method.
- Attribute
 - camera-fov
 
cameraHeading
cameraHeading: numberThe compass heading of the camera in degrees.
Setting the camera heading immediately changes the current view. For animating the view, see this component's goTo() method.
- Attribute
 - camera-heading
 
cameraPosition
cameraPosition: Array<number> | Point | stringThe position of the camera defined by a map point. It can either be set with a
Point instance
or a string in the format: longitude, latitude, elevation. E.g. "12.3808, 46.3959, 4400".
Setting the camera position immediately changes the current view. For animating the view, see this component's goTo() method.
- Attribute
 - camera-position
 
cameraTilt
cameraTilt: numberThe tilt of the camera in degrees with respect to the surface as projected down from the camera position.
Setting the camera tilt immediately changes the current view. For animating the view, see this component's goTo() method.
- Attribute
 - camera-tilt
 
center
center: Array<number> | Point | stringRepresents the center point of the view. It can be a string with the format "<longitude>, <latitude>"
or a Point instance.
Setting the center immediately changes the current view. For animating the view, see this component's goTo() method.
- Attribute
 - center
 
clippingArea
clippingArea: ExtentRepresents an optional clipping area used to define the visible extent
of a Scene in local viewingMode.
constraints
constraints: SceneViewConstraintsSpecifies constraints for the camera's tilt, altitude, and view's clip distance.
displayFilterDisabled
displayFilterDisabled: booleanIndicates whether a layer's displayFilter is honored when rendering layers in the view.
If false, the display filters are ignored and all features are rendered.
- Attribute
 - display-filter-disabled
 - Default value
 - false
 
environment
environment: SceneViewEnvironmentSpecifies various properties of the environment's visualization within the view, including lighting, background, weather, and more. The Scene will redraw automatically when any property of environment changes.
Modifying the lighting:
viewElement.environment.lighting = {
  type: "sun", // autocasts as new SunLighting()
  date: new Date(), // sets the lighting to reflect the current time of day
  directShadowsEnabled: true,
};Setting the background:
viewElement.environment = {
 background: {
    type: "color",
    color: [255, 252, 244, 1]
 },
  starsEnabled: false,
  atmosphereEnabled: false
};Changing the weather in the scene:
viewElement.environment.weather = {
  type: "rainy", // autocasts as new RainyWeather({ cloudCover: 0.7, precipitation: 0.3 })
  cloudCover: 0.7,
  precipitation: 0.3
};See also
- SunLighting
 - VirtualLighting
 - SunnyWeather
 - CloudyWeather
 - RainyWeather
 - SnowyWeather
 - FoggyWeather
 - Sample - Daylight component
 - Sample - Weather component
 
extent
extent: ExtentThe extent represents the visible portion of a map within the view as an instance of Extent.
Setting the extent immediately changes the view without animation. To animate the view, see this component's goTo() method. When the view is rotated, the extent does not update to include the newly visible portions of the map.
fatalError
fatalError: ErrorA rejected view indicates a fatal error making it unable to display.
floors
floors: Collection<string>Applies a display filter on the view for a specific set of floor levels. It can filter the map display on floor-aware layers by zero or more level IDs.
focusAreas
focusAreas: FocusAreasA container of all focus areas present in the map.
graphics
graphics: Collection<Graphic>Allows for adding graphics directly to the default graphics in the view.
Example
// Adds a graphic to the View
graphics.add(pointGraphic);
// Removes a graphic from the View
graphics.remove(pointGraphic);ground
ground: Ground | stringSpecifies the surface properties for the map. It can be either a Ground instance or a string with one of the following values:
"world-elevation""world-topobathymetry"
- Attribute
 - ground
 
highlightOptions
highlightOptions: HighlightOptionsUse the highlights property instead.
Options for configuring the highlight.
highlights
highlights: Collection<HighlightOptions>Represents a collection of HighlightOptions objects which can be used to highlight features throughout an application.
interacting
interacting: booleanIndication whether the view is being interacted with (for example when panning or by an interactive tool).
- Default value
 - false
 
itemId
itemId: stringThe ID of a WebScene item from either ArcGIS Online or ArcGIS Enterprise portal.
To configure the portal url you must set the config.portalUrl property before the Scene component loads.
- Attribute
 - item-id
 
layerViews
layerViews: Collection<LayerView>A collection containing a hierarchical list of all the created LayerViews of the operational layers in the map.
loadErrorSources
An array of objects that encountered an error while loading the component or any of its dependencies (e.g., basemap, ground, layers, tables). You may inspect the errors by accessing each object's loadError property.
magnifier
magnifier: MagnifierThe magnifier allows for showing a portion of the view as a magnifier image on top of the view.
navigating
navigating: booleanIndication whether the view is being navigated (for example when panning).
- Default value
 - false
 
padding
padding: ViewPaddingUse the padding property to make the center, and extent, etc. work off a subsection of the full view.
- Default value
 - {left: 0, top: 0, right: 0, bottom: 0}
 
performanceInfo
performanceInfo: SceneViewPerformanceInfoThis property contains performance information of the view, e.g. global memory usage and additional details for layers about memory consumption and number of features.
popup
popup: PopupA Popup object that displays general content or attributes from layers in the map.
popupDisabled
popupDisabled: booleanControls whether the popup opens automatically when users click on the view.
- Attribute
 - popup-disabled
 - Default value
 - false
 
qualityProfile
qualityProfile: "high" | "low" | "medium"Scenes can be drawn in three different quality modes: high, medium and low.
- Attribute
 - quality-profile
 
ready
ready: booleanWhen true, this property indicates whether the view successfully satisfied all dependencies,
signaling that the necessary conditions are met.
- Default value
 - false
 
resolution
resolution: numberRepresents the current value of one pixel in the unit of the view's spatialReference. The resolution is calculated by dividing the Scene component's extent width by its width.
scale
scale: numberRepresents the map scale at the center of the view.
Setting the scale immediately changes the view. For animating the view, see this component's goTo() method.
- Attribute
 - scale
 
spatialReference
spatialReference: SpatialReferenceThe spatial reference of the view. This indicates the projected or geographic coordinate system used to locate geographic features in the map.
- Default value
 - null
 
stationary
stationary: booleanIndication whether the view is animating, being navigated with or resizing.
- Default value
 - false
 
suspended
suspended: booleanIndicates if the view is visible on the page.
- Attribute
 - suspended
 - Default value
 - true
 
theme
theme: ThemeThis property specifies the base colors used by some components to render graphics and labels. This only affects those elements that would otherwise use the default orange pattern.
- Default value
 - null
 
timeExtent
timeExtent: TimeExtentThe view's time extent. Time-aware layers display their temporal data that falls within the view's time extent. Setting the view's time extent is similar to setting the spatial extent because once the time extent is set, the view updates automatically to conform to the change.
- Default value
 - null
 
updating
updating: booleanIndicates whether the view is being updated by additional data requests to the network, or by processing received data.
- Default value
 - false
 
view
view: SceneViewThe SceneView instance created and managed by the component. Accessible once the component is fully loaded.
viewingMode
viewingMode: "global" | "local"The viewing mode sets whether the view renders the earth as a sphere (global mode) or on a flat plane (local mode).
Note that the viewing mode must be set before the Scene component loads. Depending on the viewing mode different supported coordinate systems are available.
- Attribute
 - viewing-mode
 - Default value
 - "global"
 
viewpoint
viewpoint: ViewpointRepresents the current view as a Viewpoint or point of observation on the view.
Setting the viewpoint immediately changes the current view. For animating the view, see this component's goTo() method.
visibleArea
visibleArea: PolygonThe visibleArea represents the visible portion of a map within the view as an instance of a Polygon.
zoom
zoom: numberRepresents the level of detail (LOD) at the center of the view.
Setting the zoom immediately changes the current view. For animating the view, see this component's goTo() method. Setting this property in conjunction with center is a convenient way to set the initial extent of the view.
- Attribute
 - zoom
 
Methods
| Method | Signature | 
|---|---|
addLayerdeprecated  | addLayer(layer: __esri.Layer | Promise<any>, index?: number): Promise<void> | 
addLayersdeprecated  | addLayers(layers: __esri.Layer[], index?: number): Promise<void> | 
addTabledeprecated  | addTable(table: __esri.FeatureLayer): Promise<void> | 
addTablesdeprecated  | addTables(tables: __esri.FeatureLayer[], index?: number): Promise<void> | 
closePopup | closePopup(): Promise<void> | 
componentOnReady | componentOnReady(): Promise<void> | 
destroy | destroy(): Promise<void> | 
goTo | goTo(target: __esri.GoToTarget3D, options?: __esri.GoToOptions3D): Promise<unknown> | 
hitTest | hitTest(screenPoint: __esri.SceneViewScreenPoint | MouseEvent, options?: __esri.SceneViewHitTestOptions): Promise<__esri.SceneViewHitTestResult> | 
openPopup | openPopup(options?: __esri.PopupViewOpenPopupOptions): Promise<void> | 
takeScreenshot | takeScreenshot(options?: __esri.SceneViewTakeScreenshotOptions): Promise<__esri.SceneViewScreenshot> | 
toMap | toMap(screenPoint: __esri.SceneViewScreenPoint | MouseEvent, options?: __esri.SceneViewToMapOptions): __esri.Point | nullish | 
toScreen | toScreen(point: __esri.Point): __esri.SceneViewScreenPoint | 
tryFatalErrorRecovery | tryFatalErrorRecovery(): Promise<void> | 
viewOnReady | viewOnReady(callback?: (): void, errback?: (error: Error) => void): Promise<void> | 
whenAnalysisView | whenAnalysisView(analysis: __esri.Analysis): Promise<__esri.AnalysisView3DUnion> | 
whenLayerView | whenLayerView(layer: __esri.Layer): Promise<__esri.LayerView> | 
addLayer
addLayer(layer: __esri.Layer | Promise<any>, index?: number): Promise<void>element.map.add(layer) instead.Adds a layer to the map's layers collection.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| layer | Layer | Promise<any> | |
| index | number | undefined | 
- Returns
 - Promise<void>
 
addLayers
addLayers(layers: __esri.Layer[], index?: number): Promise<void>element.map.addMany([layer]) instead.Adds a layer or array of layers to the map's layers collection.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| layers | Array<Layer> | |
| index | number | undefined | 
- Returns
 - Promise<void>
 
addTable
addTable(table: __esri.FeatureLayer): Promise<void>element.map.tables.add(table) instead.Adds a table to the map's tables collection.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| table | FeatureLayer | 
- Returns
 - Promise<void>
 
addTables
addTables(tables: __esri.FeatureLayer[], index?: number): Promise<void>element.map.tables.addMany([table]) instead.Adds a table or array of tables to the map's tables collection.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| tables | Array<FeatureLayer> | |
| index | number | undefined | 
- Returns
 - Promise<void>
 
componentOnReady
componentOnReady(): Promise<void>Create a promise that resolves once component is fully loaded.
Example
const arcgisScene = document.querySelector("arcgis-scene");
document.body.append(arcgisScene);
await arcgisScene.componentOnReady();
console.log("arcgis-scene is ready to go!");- Returns
 - Promise<void>
 
destroy
destroy(): Promise<void>Destroys the Scene component, and any associated resources, including its map, popup, and removes components or other UI DOM elements added to it.
- Returns
 - Promise<void>
 
goTo
goTo(target: __esri.GoToTarget3D, options?: __esri.GoToOptions3D): Promise<unknown>Sets the view to a given target.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| target | any | |
| options | GoToOptions3D | undefined | 
- Returns
 - Promise<unknown>
 
hitTest
hitTest(screenPoint: __esri.SceneViewScreenPoint | MouseEvent, options?: __esri.SceneViewHitTestOptions): Promise<__esri.SceneViewHitTestResult>Returns hit test results from each layer that intersects the specified screen coordinates.
viewElement.addEventListener("arcgisViewClick", (event) => {
  viewElement.hitTest(event.detail).then((response) => {
     const result = response.results[0];
     if (result?.type === "graphic") {
        const { longitude, latitude } = result.mapPoint;
        console.log("Hit graphic at (" + longitude + ", " + latitude + ")", result.graphic);
     } else {
        console.log("Did not hit any graphic");
     }
  });
});Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| screenPoint | MouseEvent | SceneViewScreenPoint | |
| options | SceneViewHitTestOptions | undefined | 
- Returns
 - Promise<SceneViewHitTestResult>
 
openPopup
openPopup(options?: __esri.PopupViewOpenPopupOptions): Promise<void>Opens the popup based on input options.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| options | PopupViewOpenPopupOptions | undefined | 
- Returns
 - Promise<void>
 
takeScreenshot
takeScreenshot(options?: __esri.SceneViewTakeScreenshotOptions): Promise<__esri.SceneViewScreenshot>Creates a screenshot of the current view.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| options | SceneViewTakeScreenshotOptions | undefined | 
- Returns
 - Promise<SceneViewScreenshot>
 
toMap
toMap(screenPoint: __esri.SceneViewScreenPoint | MouseEvent, options?: __esri.SceneViewToMapOptions): __esri.Point | nullishConverts the given screen point to a map point.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| screenPoint | MouseEvent | SceneViewScreenPoint | |
| options | SceneViewToMapOptions | undefined | 
- Returns
 - Point | null | undefined
 
toScreen
toScreen(point: __esri.Point): __esri.SceneViewScreenPointConverts the given map point to a screen point.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| point | Point | 
- Returns
 - SceneViewScreenPoint
 
tryFatalErrorRecovery
tryFatalErrorRecovery(): Promise<void>Call this method to clear any fatal errors resulting from a lost WebGL context.
- Returns
 - Promise<void>
 
viewOnReady
viewOnReady(callback?: (): void, errback?: (error: Error) => void): Promise<void>viewOnReady() may be leveraged once an instance of the component and its underlying view is created and ready.
This method takes two input parameters, a callback function and an errback function, and returns a promise. The callback executes when the promise resolves, and the errback executes if the promise is rejected.
Example
const viewElement = document.querySelector("arcgis-scene");
await viewElement.viewOnReady();
// The view is now ready to be used.
viewElement.map.add(new FeatureLayer({...}));Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| callback | ((() => void)) | undefined | |
| errback | (((error: Error) => void)) | undefined | 
- Returns
 - Promise<void>
 
whenAnalysisView
whenAnalysisView(analysis: __esri.Analysis): Promise<__esri.AnalysisView3DUnion>Gets the analysis view created for the given analysis object.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| analysis | Analysis | 
whenLayerView
whenLayerView(layer: __esri.Layer): Promise<__esri.LayerView>Gets the layer view created on the view for the given layer.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| layer | Layer | 
- Returns
 - Promise<LayerView>
 
Events
arcgisLoadError
arcgisLoadError: CustomEvent<void>Fires when a ArcgisScene fails to load or if one of its dependencies fails to load (e.g., basemap, ground, layers).
- See also
 
Example
viewElement.addEventListener("arcgisLoadError", () => {
  console.log(viewElement.loadErrorSources);
});arcgisViewAnalysisViewCreate
arcgisViewAnalysisViewCreate: CustomEvent<ViewAnalysisViewCreateEvent>Fires when the view for an analysis is created.
arcgisViewAnalysisViewCreateError
arcgisViewAnalysisViewCreateError: CustomEvent<ViewAnalysisViewCreateErrorEvent>Fires when an error occurs during the creation of an analysis view after an analysis is added to the view.
arcgisViewAnalysisViewDestroy
arcgisViewAnalysisViewDestroy: CustomEvent<ViewAnalysisViewDestroyEvent>Fires after an analysis view is destroyed.
arcgisViewChange
arcgisViewChange: CustomEvent<void>This event is for view related property changes: zoom, scale, center, rotation, extent,
camera, viewpoint. This event will also emit if stationary toggles from true to false.
arcgisViewClick
arcgisViewClick: CustomEvent<ViewClickEvent>Fires after a user clicks on the view.
viewElement.addEventListener("arcgisViewClick", (event) => {
  viewElement.hitTest(event.detail).then((response) => {
     const result = response.results[0];
     // ....
  });
});arcgisViewDoubleClick
arcgisViewDoubleClick: CustomEvent<ViewDoubleClickEvent>Fires after double-clicking on the view.
arcgisViewDrag
arcgisViewDrag: CustomEvent<ViewDragEvent>Fires during a pointer drag on the view.
arcgisViewHold
arcgisViewHold: CustomEvent<ViewHoldEvent>Fires after holding either a mouse button or a single finger on the view for a short amount of time.
arcgisViewImmediateClick
arcgisViewImmediateClick: CustomEvent<ViewImmediateClickEvent>Fires right after a user clicks on the view.
arcgisViewImmediateDoubleClick
arcgisViewImmediateDoubleClick: CustomEvent<ViewImmediateDoubleClickEvent>Is emitted after two consecutive immediate-click events.
arcgisViewKeyDown
arcgisViewKeyDown: CustomEvent<ViewKeyDownEvent>Fires after a keyboard key is pressed.
arcgisViewKeyUp
arcgisViewKeyUp: CustomEvent<ViewKeyUpEvent>Fires after a keyboard key is released.
arcgisViewLayerviewCreate
arcgisViewLayerviewCreate: CustomEvent<ViewLayerviewCreateEvent>Fires after each layer in the map has a corresponding LayerView created and rendered in the view.
arcgisViewLayerviewCreateError
arcgisViewLayerviewCreateError: CustomEvent<ViewLayerviewCreateErrorEvent>Fires when an error emits during the creation of a LayerView after a layer has been added to the map.
arcgisViewLayerviewDestroy
arcgisViewLayerviewDestroy: CustomEvent<ViewLayerviewDestroyEvent>Fires after a LayerView is destroyed and is no longer rendered in the view.
arcgisViewMouseWheel
arcgisViewMouseWheel: CustomEvent<ViewMouseWheelEvent>Fires when a wheel button of a pointing device (typically a mouse) is scrolled on the view.
arcgisViewPointerDown
arcgisViewPointerDown: CustomEvent<ViewPointerDownEvent>Fires after a mouse button is pressed, or a finger touches the display.
arcgisViewPointerEnter
arcgisViewPointerEnter: CustomEvent<ViewPointerEnterEvent>Fires after a mouse cursor enters the view, or a display touch begins.
arcgisViewPointerLeave
arcgisViewPointerLeave: CustomEvent<ViewPointerLeaveEvent>Fires after a mouse cursor leaves the view, or a display touch ends.
arcgisViewPointerMove
arcgisViewPointerMove: CustomEvent<ViewPointerMoveEvent>Fires after the mouse or a finger on the display moves.
arcgisViewPointerUp
arcgisViewPointerUp: CustomEvent<ViewPointerUpEvent>Fires after a mouse button is released, or a display touch ends.
arcgisViewReadyChange
arcgisViewReadyChange: CustomEvent<void>This event is for the ready property and will be emitted when the view is ready. This event will also emit if the map property is changed.
arcgisViewReadyError
arcgisViewReadyError: CustomEvent<void>Fires if the view encounters a content or rendering error.
Example
viewElement.addEventListener("arcgisViewReadyError", () => {
  // handle error
});Slots
| Name | Description | 
|---|---|
default(unnamed) | Default slot for adding components to the scene. User is responsible for positioning the content via CSS.  | 
top-left | Slot for components positioned in the top-left corner.  | 
top-right | Slot for components positioned in the top-right corner.  | 
bottom-left | Slot for components positioned in the bottom-left corner.  | 
bottom-right | Slot for components positioned in the bottom-right corner.  | 
top-start | Slot for components positioned at the top-start (top-left in LTR, top-right in RTL).  | 
top-end | Slot for components positioned at the top-end (top-right in LTR, top-left in RTL).  | 
bottom-start | Slot for components positioned at the bottom-start (bottom-left in LTR, bottom-right in RTL).  | 
bottom-end | Slot for components positioned at the bottom-end (bottom-right in LTR, bottom-left in RTL).  | 
popup | Slot for the Popup component to open automatically on click. When using this slot, the   | 
default (unnamed)
Default slot for adding components to the scene. User is responsible for positioning the content via CSS.
bottom-start
Slot for components positioned at the bottom-start (bottom-left in LTR, bottom-right in RTL).
bottom-end
Slot for components positioned at the bottom-end (bottom-right in LTR, bottom-left in RTL).
popup
Slot for the Popup component to open automatically on click. When using this slot, the popup-disabled attribute must be set to true. Only the Popup component can be placed in this slot.
Styles
| Name | Description | 
|---|---|
--arcgis-layout-overlay-space-top | Since 4.34 Specifies the top padding for the layout.  | 
--arcgis-layout-overlay-space-bottom | Since 4.34 Specifies the bottom padding for the layout.  | 
--arcgis-layout-overlay-space-left | Since 4.34 Specifies the left padding for the layout.  | 
--arcgis-layout-overlay-space-right | Since 4.34 Specifies the right padding for the layout.  |