當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS Slide.visibleLayers用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/webscene/Slide"], (Slide) => { /* code goes here */ });

ESM: import Slide from "@arcgis/core/webscene/Slide";

類: esri/webscene/Slide

繼承: Slide > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

Slide.visibleLayers函數(或屬性)的定義如下:

visibleLayers Collection<Accessor> autocast


場景的可見層。這是一個對象集合,用於存儲對 scene layersground layers 的引用(按 ID),當幻燈片應用於 SceneView 時,這些引用設置為 visible

分配可見層時,將自動轉換以下類型的值:

下表概述了集合中每個對象的規範。

屬性:

類型說明
id String
來自 Object[]

當幻燈片應用於視圖時,WebSceneGround 中的 layer 的 ID,在 SceneView 中生成 visible

sublayerIds Number[]
來自 Object[]

layer id 指定的圖層上可見子圖層的服務 id。如果這不存在,則應用幻燈片時子層的可見性不會改變。

例子:

// Update the visible layers to the second layer in the scene, and the
// first elevation layer in the ground.
slide.visibleLayers = [
  { id: scene.layers.getItemAt(1).id }
  { id: scene.ground.layers.getItemAt(0).id }
];

// Equivalent using convenience autocasting
slide.visibleLayers = [scene.layers.getItemAt(0), scene.ground.layers.getItemAt(0)];

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Slide.visibleLayers。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。