import SceneFilter from "@arcgis/core/layers/support/SceneFilter.js";const SceneFilter = await $arcgis.import("@arcgis/core/layers/support/SceneFilter.js");- Inheritance
- SceneFilter→
Accessor
- 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.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| readonly inherited | ||
| | ||
| |
geometries
- 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
- Type
- SpatialRelationship
The type of masking to perform.
| Illustration | Modification | Description |
|---|---|---|
![]() | disjoint - removes selected area | Remove 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. |
![]() | contains - displays only selected area | Define 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
| Method | Signature | Class |
|---|---|---|
| inherited static | fromJSON(json: any): any | |
| clone(): SceneFilter | | |
| inherited | toJSON(): any |
fromJSON
- Signature
-
fromJSON (json: any): any
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | 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
- 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
- Signature
-
toJSON (): any
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.

