Types
import type { SublayersOwner } from "@arcgis/core/layers/mixins/SublayersOwner.js";- Subclasses:
- MapImageLayer, TileLayer
Mixin for MapImageLayer and TileLayer.
Properties
| Property | Type | Class |
|---|---|---|
Collection<Sublayer> | null | undefined | |
subtables
autocast
Property
- Type
- Collection<Sublayer> | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.30
A flat Collection of all the tables in the layer including the tables of its sublayers. Apps can add them to a map as standalone tables.
Example
// Apps can add tables to a map as standalone tableslayer.subtables.forEach((subtable) => { const featureLayer = await subtable.createFeatureLayer(); map.tables.add(featureLayer);});Methods
| Method | Signature | Class |
|---|---|---|
createServiceSublayers(): Collection<Sublayer> | | |
findSublayerById(id: number): Sublayer | null | undefined | |
createServiceSublayers
Method
- Signature
-
createServiceSublayers (): Collection<Sublayer>
Returns a deep clone of a map service's sublayers as defined by the service. This is useful for scenarios when the developer is unfamiliar with the service sublayers and needs to "reset" the layer's sublayers to match those defined by the service.
- Returns
- Collection<Sublayer>
A collection of sublayers as defined by the map service.
Example
Layer.fromPortalItem({ portalItem: { portalId: "dbb9b48477444015912061b182f196b9" }}).then(function(layer){ let serviceSublayers = layer.createServiceSublayers(); layer.sublayers = serviceSublayers;}); findSublayerById
Method
- Signature
-
findSublayerById (id: number): Sublayer | null | undefined
Returns the sublayer with the given layerId.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| id | The Sublayer.id of the sublayer. | |
Example
// returns the sublayer with a layerId of 0let sublayer0 = layer.findSublayerById(0);