BuildingFilter
require(["esri/layers/support/BuildingFilter"], function(BuildingFilter) { /* code goes here */ });
esri/layers/support/BuildingFilter
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.
// 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 Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | Description of the filter for display in UIs, for example when the filter is edited in ArcGIS Pro. more details | more details | BuildingFilter | |
Collection<BuildingFilterBlock> | Filter blocks define which features should be visible in the affected BuildingSceneLayer and how the filtered features are drawn. more details | more details | BuildingFilter | |
String | Unique filter id. more details | more details | BuildingFilter | |
String | Name of the filter for display in UIs, for example when the filter is edited in ArcGIS Pro. more details | more details | BuildingFilter |
Property Details
- description String
Description of the filter for display in UIs, for example when the filter is edited in ArcGIS Pro.
- filterBlocks Collection<BuildingFilterBlock>
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 asolid
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
Name | Return Type | Summary | Class | |
---|---|---|---|---|
* | 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 details | BuildingFilter | |
Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | more details | BuildingFilter |
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 ObjectA 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:Type Description * 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:Type Description Object The 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.
optionalfilterMode ObjectThis 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:
- optionaltype StringDefault 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"
optionaltitle StringTitle of the filter for display in UIs, for example when the filter block is edited in ArcGIS Pro.