import type { SceneService } from "@arcgis/core/layers/mixins/SceneService.js";- Subclasses:
- BuildingSceneLayer, IntegratedMeshLayer, PointCloudLayer, SceneLayer, VoxelLayer
Mixin for layers using a scene service.
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| | ||
| | ||
| | ||
version readonly | |
layerId
- Type
- number
The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single layer with the portalItem property from a service containing multiple layers. You can specify this value in one of two scenarios:
- When loading the layer via the portalItem property.
- When pointing the layer url directly to the Scene Service.
If a layerId is not specified in either of the above scenarios, then the first layer
in the service (layerId = 0) is selected.
Examples
// while these examples use a SceneLayer, the same pattern can be// used for other layers that may be loaded from portalItem ids
// loads the third layer in the given Portal Itemlet layer = new SceneLayer({ portalItem: { id: "73df987984b24094b848d580eb83b0fb" }, layerId: 2});// If not specified, the first layer (layerId: 0) will be returnedlet layer = new SceneLayer({ portalItem: { id: "73df987984b24094b848d580eb83b0fb" }});// Can also be used if URL points to service and not layerlet layer = new SceneLayer({ url: "https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/DevA_Trees/SceneServer", layerId: 0 // Notice that the url doesn't end with /2});// This code returns the same layer as the previous snippetlet layer = new SceneLayer({ url: "https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/DevA_Trees/SceneServer/layers/0", // The layer id is specified in the URL}); url
The URL of the REST endpoint of the layer or scene service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online.
The layer may be specified using the layerId property when the url points directly to a service and not a specific layer. If layerId is not specified, then it will default to the first layer in the service.
Examples
// Layer from Scene Service on ArcGIS Serverlet sceneLayer = new SceneLayer({ url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Paris_3D_Local_WSL2/SceneServer/layers/0"});// Can also be used if URL points to service and not layerlet layer = new SceneLayer({ // Notice that the url doesn't end with /0 url: "https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/DevA_Trees/SceneServer", layerId: 0}); version
- Type
- SceneServiceVersion
The version of the scene service specification used for this service.
- See also
Example
// Prints the version to the console - e.g. 1.4, 1.5, etc.console.log(layer.version.versionString);