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


JavaScript ArcGIS FeatureLayer.featureEffect用法及代碼示例


基本信息

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

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

ESM: import FeatureLayer from "@arcgis/core/layers/FeatureLayer";

類: esri/layers/FeatureLayer

繼承: FeatureLayer > Layer > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

FeatureLayer.featureEffect函數(或屬性)的定義如下:

featureEffect FeatureEffect autocast


自從:ArcGIS 適用於 JavaScript 4.22 的 API

featureEffect 可用於吸引感興趣的注意力特征。它允許通過 filter 選擇特征,並且將 includedEffectexcludedEffect 應用於分別通過或未通過過濾器要求的那些特征。

注意

  • 如果需要將效果應用到整個圖層,請設置效果屬性。
  • 如果在圖層上設置了featureEffect,它將被layerView.featureEffect 繼承,除非開發人員在圖層視圖上覆蓋它。如果設置了這兩個屬性,layerView.featureEffect 將優先於 layer.featureEffect
  • 如果應用了以下所有四個屬性,那麽它們將按以下順序應用:featureEffect、效果、不透明度和混合模式。

已知限製

例子:

// gray out features that fall outside of the 3 mile buffer of the mouse's location
// by setting feature effect on excluded features
layer.featureEffect = new FeatureEffect({
  filter: new FeatureFilter({
    geometry: filterGeometry,
    spatialRelationship: "intersects",
    distance: 3,
    units: "miles"
  }),
  excludedEffect: "grayscale(100%) opacity(30%)"
});
// Apply a drop-shadow feature effect to the features that intersect the borough boundaries,
// while applying blur and brightness effects to the features that are excluded from filter criteria.
// The resulting map will make it easier to spot if the residents are more likely to experience deprivation
// if they live on a borough boundary.
const featureFilter = new FeatureFilter({
  where: "BoroughEdge='true'"
});
layer.featureEffect = new FeatureEffect({
  filter: featureFilter,
  includedEffect: "drop-shadow(3px, 3px, 3px, black)",
  excludedEffect: "blur(1px) brightness(65%)"
});

相關用法


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