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


JavaScript ArcGIS Legend.respectLayerVisibility用法及代碼示例

基本信息

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

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

ESM: import Legend from "@arcgis/core/widgets/Legend";

類: esri/widgets/Legend

繼承: Legend > Widget > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

Legend.respectLayerVisibility函數(或屬性)的定義如下:

respectLayerVisibility Boolean


自從:ArcGIS 適用於 JavaScript 4.13 的 API

確定是否尊重Map中控製圖例可見性的圖層屬性 (minScale,maxScale,legendEnabled)。默認情況下,圖層的圖例元素不會渲染在給出以下條件的圖例中:

當圖例的 respectLayerVisibility 屬性設置為 false 時,Map中每個圖層的圖例元素將始終顯示,因此忽略Map中每個圖層的 minScalemaxScalelegendEnabled 屬性Map。

默認值:true

例子:

// Always displays legend elements for the map's layers
// regardless of their minScale, maxScale, and legendEnabled properties
legend.respectLayerVisibility = false;

相關用法


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