当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS StreamLayer.featureEffect用法及代码示例


基本信息

以下是所在类或对象的基本信息。

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

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

类: esri/layers/StreamLayer

继承: StreamLayer > Layer > Accessor

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

StreamLayer.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大神的英文原创作品 StreamLayer.featureEffect。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。