@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
127 lines (125 loc) • 8.12 kB
TypeScript
import type FeatureEffect from "../support/FeatureEffect.js";
import type { FeatureEffectProperties } from "../support/FeatureEffect.js";
export interface FeatureEffectLayerProperties {
/**
* The featureEffect can be used to draw attention to features of interest.
* It allows for the selection of features via a
* [filter](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureEffect/#filter), and an
* [includedEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureEffect/#includedEffect) and
* [excludedEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureEffect/#excludedEffect)
* are applied to those features that respectively pass or fail the filter requirements.
*
* > **Notes**
* >
* > - Set the [effect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#effect) property if the effect needs to be applied to the entire layer.
* > - If the `featureEffect` is set on the layer, it will be inherited by `layerView.featureEffect` unless the developer overrides it on the layer view. The `layerView.featureEffect`
* > will take precedence over `layer.featureEffect` if both properties are set.
* > - If all of the following four properties are applied, then they will be applied in this order: [featureEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureEffectLayer/#featureEffect),
* > [effect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#effect), [opacity](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#opacity) and [blendMode](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#blendMode).
*
* > [!WARNING]
* >
* > **Known Limitations**
* >
* > FeatureEffect is not supported in the following scenarios:
* > * In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)
* > * When [FeatureReductionCluster](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#featureReduction) is enabled
* > * See [print](https://developers.arcgis.com/javascript/latest/references/core/rest/print/) for known printing limitations.
*
* @since 4.22
* @see [Sample - Apply effects to features](https://developers.arcgis.com/javascript/latest/sample-code/featureeffect-geometry/)
* @see [Sample - Apply drop-shadow effect to a layerView](https://developers.arcgis.com/javascript/latest/sample-code/featureeffect-drop-shadow/)
* @see [Layer effect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#effect)
* @example
* // 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%)"
* });
* @example
* // 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%)"
* });
*/
featureEffect?: FeatureEffectProperties | null;
}
/**
* FeatureEffectLayer is a mixin that adds [featureEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureEffectLayer/#featureEffect) properties to a layer.
*
* @since 4.22
*/
export abstract class FeatureEffectLayer {
constructor(...args: any[]);
/**
* The featureEffect can be used to draw attention to features of interest.
* It allows for the selection of features via a
* [filter](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureEffect/#filter), and an
* [includedEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureEffect/#includedEffect) and
* [excludedEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureEffect/#excludedEffect)
* are applied to those features that respectively pass or fail the filter requirements.
*
* > **Notes**
* >
* > - Set the [effect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#effect) property if the effect needs to be applied to the entire layer.
* > - If the `featureEffect` is set on the layer, it will be inherited by `layerView.featureEffect` unless the developer overrides it on the layer view. The `layerView.featureEffect`
* > will take precedence over `layer.featureEffect` if both properties are set.
* > - If all of the following four properties are applied, then they will be applied in this order: [featureEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureEffectLayer/#featureEffect),
* > [effect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#effect), [opacity](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#opacity) and [blendMode](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#blendMode).
*
* > [!WARNING]
* >
* > **Known Limitations**
* >
* > FeatureEffect is not supported in the following scenarios:
* > * In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)
* > * When [FeatureReductionCluster](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#featureReduction) is enabled
* > * See [print](https://developers.arcgis.com/javascript/latest/references/core/rest/print/) for known printing limitations.
*
* @since 4.22
* @see [Sample - Apply effects to features](https://developers.arcgis.com/javascript/latest/sample-code/featureeffect-geometry/)
* @see [Sample - Apply drop-shadow effect to a layerView](https://developers.arcgis.com/javascript/latest/sample-code/featureeffect-drop-shadow/)
* @see [Layer effect](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/BlendLayer/#effect)
* @example
* // 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%)"
* });
* @example
* // 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%)"
* });
*/
get featureEffect(): FeatureEffect | null | undefined;
set featureEffect(value: FeatureEffectProperties | null | undefined);
}