import SceneFilter from "@arcgis/core/layers/support/SceneFilter.js";
Inheritance
SceneFilterAccessor
Since
ArcGIS Maps SDK for JavaScript 4.24

A SceneFilter defines parameters for setting a client-side spatial filter on a SceneLayer.filter.

It is possible to define a collection of polygon geometries which will mask out different parts of the layer. The spatialRelationship attribute defines if the content inside or outside of the polygons should be masked.

This filter is also persisted in WebScenes and when saving the SceneLayer.filter.

See also

Constructors

Constructor

Constructor

Parameters

ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

geometries

autocast Property
Type
Collection<Polygon>

The geometries to apply to the spatial filter.

The spatial relationship as specified by spatialRelationship will indicate how the geometry should be used to filter features. Multiple, overlapping geometries are applied as the union of their spatialRelationship operation. For multiple rings within a polygon the even odd rule is used to determine whether a point is inside.

Known Limitations

Polygon is the only supported geometries type.

spatialRelationship

Property
Type
SpatialRelationship

The type of masking to perform.

IllustrationModificationDescription
filter-type-disjointdisjoint - removes selected areaRemove portions of the scene layer. Use a polygon and don't draw the parts inside that polygon. For example to add another layer which shows a new development for that part of the city.
filter-type-containscontains - displays only selected areaDefine an area of interest. Use a polygon and draw only parts of the scene layer inside that polygon. For example, to show only a portion of a scene layer within the boundaries of a city.
See also
Default value
"disjoint"

Methods

MethodSignatureClass
inherited static
fromJSON(json: any): any
clone(): SceneFilter
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters

ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

clone

Method
Signature
clone (): SceneFilter

Creates a deep clone of the SceneFilter object.

Returns
SceneFilter

A new instance of a SceneFilter object equal to the object used to call .clone().

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.

Type definitions

SpatialRelationship

Type definition
Type
"disjoint" | "contains"