-
sublayers
Collection<Sublayer>
autocast
Collection of Sublayer 對象,允許您更改 MapImageLayer 的一個或多個子圖層的屬性。如果未指定此屬性,則服務中的所有子圖層都將按照服務中的定義顯示。如果將一個空數組傳遞給此屬性,則服務中的任何子圖層都不會顯示在圖層中。
所有子圖層都按照它們在視圖中的繪製順序(從下到上)進行引用。它們可能是 added 、 removed 或 reordered 使用 Collection 方法。因為 Sublayer 擴展了 Accessor ,所以它的屬性可能是 watched 。
例子:
// Only includes the first sublayer from the map service let layer = new MapImageLayer({ url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer", sublayers: [{ id: 0 }] });
// toggles the visibility of the first sublayer to false layer.findSublayerById(0).visible = false;
// sublayers from the service are excluded from the layer layer = new MapImageLayer({ url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer", sublayers: [] });
// Moves the cities sublayer from index 3 to index 0. let citiesLayer = layer.sublayers.getItemAt(3); layer.sublayers.reorder(citiesLayer, 0);
// Overrides the drawing info on the layer with a custom renderer let citiesLayer = layer.sublayers.getItemAt(3); citiesLayer.renderer = { type: "simple", // autocasts as new SimpleRenderer() symbol: { type: "simple-marker", // autocasts as new SimpleMarkerSymbol() color: "blue", size: 3 } };
基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/layers/MapImageLayer"], (MapImageLayer) => { /* code goes here */ });
ESM:
import MapImageLayer from "@arcgis/core/layers/MapImageLayer";
類:
esri/layers/MapImageLayer
繼承: MapImageLayer > Layer > Accessor
自從:用於 JavaScript 4.0 的 ArcGIS API
用法說明
MapImageLayer.sublayers
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS MapImageLayer.minScale用法及代碼示例
- JavaScript ArcGIS MapImageLayer.customParameters用法及代碼示例
- JavaScript ArcGIS MapImageLayer.portalItem用法及代碼示例
- JavaScript ArcGIS MapImageLayer.fetchImage用法及代碼示例
- JavaScript ArcGIS MapImageLayer.loadAll用法及代碼示例
- JavaScript ArcGIS MapImageLayer.opacity用法及代碼示例
- JavaScript ArcGIS MapImageLayer.timeOffset用法及代碼示例
- JavaScript ArcGIS MapImageLayer.fullExtent用法及代碼示例
- JavaScript ArcGIS MapImageLayer.findSublayerById用法及代碼示例
- JavaScript ArcGIS MapImageLayer.url用法及代碼示例
- JavaScript ArcGIS MapImageLayer.datesInUnknownTimezone用法及代碼示例
- JavaScript ArcGIS MapImageLayer.useViewTime用法及代碼示例
- JavaScript ArcGIS MapImageLayer.maxScale用法及代碼示例
- JavaScript ArcGIS MapImageLayer.version用法及代碼示例
- JavaScript ArcGIS MapImageLayer.on用法及代碼示例
- JavaScript ArcGIS MapImageLayer.refreshInterval用法及代碼示例
- JavaScript ArcGIS MapImageLayer.allSublayers用法及代碼示例
- JavaScript ArcGIS MapImageLayer.when用法及代碼示例
- JavaScript ArcGIS MapImageLayer.timeInfo用法及代碼示例
- JavaScript ArcGIS MapImageLayer.createServiceSublayers用法及代碼示例
- JavaScript ArcGIS MapImageLayer.visible用法及代碼示例
- JavaScript ArcGIS MapImageLayer.effect用法及代碼示例
- JavaScript ArcGIS MapImageLayer.timeExtent用法及代碼示例
- JavaScript ArcGIS MapImageLayer layerview-create-error事件用法及代碼示例
- JavaScript ArcGIS MapImageLayer layerview-create事件用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 MapImageLayer.sublayers。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。