require(["esri/layers/support/BuildingFilter"], function(BuildingFilter) { /* code goes here */ });
Class: esri/layers/support/BuildingFilter
Since: ArcGIS API 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"
  }]
});
// 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

new BuildingFilter(properties)
Parameter:
properties Object
optional

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

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String

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

more details
more detailsBuildingFilter
Collection<BuildingFilterBlock>

Filter blocks define which features should be visible in the affected BuildingSceneLayer and how the filtered features are drawn.

more details
more detailsBuildingFilter
String

Unique filter id.

more details
more detailsBuildingFilter
String

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

more details
more detailsBuildingFilter

Property Details

description String

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

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.

Known Limitations

Filter blocks with a wire-frame filter mode are currently not rendered.

id Stringreadonly

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

name String

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

Method Overview

NameReturn TypeSummaryClass
*

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform.

more details
more detailsBuildingFilter
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsBuildingFilter

Method Details

fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. 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.

Parameter:
json Object

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:
TypeDescription
*Returns a new instance of this class.
toJSON(){Object}

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

Returns:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

Type Definitions

BuildingFilterBlock Object

Object contained in the filterBlocks collection:

Properties:
filterExpression String

The SQL where clause used to match features to this filter block. Only the features that satisfy the filter expression are displayed in the SceneView. This property is evaluated on the client using the cached attributes and it only supports standardized SQL.

filterMode Object
optional

This object contains information about the filter mode of the filter block. This property can generally be omitted, since only solid filter blocks are rendered in the JS API.

Specification:
type String
optional
Default Value:solid

Defines how features are drawn while the filter is active. The same filter mode type can only be used once in a filter. To filter multiple elements as solid, add them to a single filter block instead of creating several filter blocks that use the solid filter mode.

Possible Values:"solid"|"wire-frame"

title String
optional

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

API Reference search results

NameTypeModule
Loading...