import BuildingFilter from "@arcgis/core/layers/support/BuildingFilter.js";
Inheritance
BuildingFilterAccessor
Since
ArcGIS Maps SDK for JavaScript 4.12

The BuildingFilter class defines a set of conditions that can be used to show or hide specific features of a BuildingSceneLayer in the SceneView. For example, if you want to see parts of a building that are on the second floor, you can set a filter to only show the second floor. The filter can be activated on a layer by adding it to the BuildingSceneLayer.filters collection and assigning id to BuildingSceneLayer.activeFilterId. Once the filter is activated, only the features that satisfy the conditions defined by filterBlocks are displayed in the SceneView.

See also
Example
// define a floor filter
const buildingFilter = new BuildingFilter({
filterBlocks: [{
// an SQL expression that filters using the BldgLevel field
filterExpression: "BldgLevel = 3",
filterMode: {
type: "wire-frame",
edges: {
type: "solid",
color: [0, 0, 0, 0.8]
}
}
}]
});
// set the filter in the filters array on the layer
buildingLayer.filters = [buildingFilter];
// specify which filter is the one that should be applied
buildingLayer.activeFilterId = buildingFilter.id;

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.

description

Property
Type
string | null | undefined

Description of the filter for display in UIs, for example when the filter is edited in ArcGIS Pro.

filterBlocks

autocast Property
Type
Collection<BuildingFilterBlock> | null | undefined

Filter blocks define which features should be visible in the affected BuildingSceneLayer and how the filtered features are drawn. A filter should contain at least one filter block.

The order of filter blocks influences the order in which the filter blocks are applied. For example, if a filter block using a wire-frame mode precedes a solid filter block in the collection, elements that match either filter block will be drawn as wireframe.

id

readonly Property
Type
string

Unique filter id. Assign this id to BuildingSceneLayer.activeFilterId to activate the filter.

name

Property
Type
string | null | undefined

Name of the filter for display in UIs, for example when the filter is edited in ArcGIS Pro.

Methods

MethodSignatureClass
inherited static
fromJSON(json: any): any
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.

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.