esri/views/layers/BuildingComponentSublayerView
Represents the sublayer view of a BuildingComponentSublayer. The sublayer view can be used for queries of features that are loaded in the view. Sublayer views can be accessed via the sublayerViews property on BuildingSceneLayerView:
// query all sublayers for features that satisfy the sql expression
let query = new Query();
query.where = "FamilyType = 'Landscape'";
view.whenLayerView(buildingSceneLayer).then(function(bslv) {
bslv.sublayerViews.forEach(function(componentSublayerView) {
componentSublayerView.queryFeatures(query).then(function(result) {
console.log(result.features);
});
});
});
Queries on the BuildingComponentSublayerView is executed against features that have been loaded for the current view. This means that only visible features are guaranteed to be available once the layer has finished updating. The query methods on the BuildingComponentSublayerView should not be used when the intention is to query or search within the whole dataset, instead the query methods on the BuildingComponentSublayer should be used.
The highlight method can be called on a specific sublayer view:
view.whenLayerView(buildingSceneLayer).then(function(bslv) {
// get the sublayer view of the component sublayer with id 1
const sublayerView = bslv.sublayerViews.find(function(sublayerView) {
return sublayerView.sublayer.id === 1;
});
const query = sublayerView.createQuery();
query.spatialRelationship = "contains";
query.geometry = polygonGeometry;
// query sublayer view
sublayerView.queryObjectIds(query).then(function(result) {
sublayerView.highlight(result);
});
});
- See also
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
A list of attribute fields fetched for each feature including fields required for layer rendering and additional fields defined on the BuildingComponentSublayer.outFields or BuildingSceneLayer.outFields. | BuildingComponentSublayerView | ||
The name of the class. | Accessor | ||
Applies a client-side FeatureFilter to the displayed data. | BuildingComponentSublayerView | ||
The sublayer being viewed. | BuildingComponentSublayerView | ||
Value is | BuildingComponentSublayerView | ||
Value is | BuildingComponentSublayerView |
Property Details
-
A list of attribute fields fetched for each feature including fields required for layer rendering and additional fields defined on the BuildingComponentSublayer.outFields or BuildingSceneLayer.outFields. The availableFields is populated when the layer view is finished updating. Use this list when querying features on the client-side.
- See also
-
filter
filter FeatureFilterautocast
Since: ArcGIS Maps SDK for JavaScript 4.18BuildingComponentSublayerView since 4.17, filter added at 4.18. -
Applies a client-side FeatureFilter to the displayed data. Only the features that satisfy the filter are displayed. The fields to be used for the filter must be present in the layer view's availableFields list.
Known Limitations
- The timeExtent property is not supported on a SceneLayerView filter.
- Only spatial filters with spatialRelationship
set to
contains
,intersects
ordisjoint
are supported.
-
sublayer
sublayer BuildingComponentSublayerreadonly
-
The sublayer being viewed.
-
suspended
suspended Booleanreadonly
-
Value is
true
if the sublayer is suspended (i.e., sublayer will not redraw or update itself when the extent changes).
-
updating
updating Booleanreadonly
-
Value is
true
when the sublayer is updating; for example, if it is in the process of fetching data.
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Creates a query parameter object that can be used to fetch features as they are being displayed. | BuildingComponentSublayerView | ||
Returns true if a named group of handles exist. | Accessor | ||
Highlights the given feature(s). | BuildingComponentSublayerView | ||
Executes a Query against features in the layer view and returns the 3D Extent of features that satisfy the query. | BuildingComponentSublayerView | ||
Executes a Query against features in the layer view and returns the number of features that satisfy the query. | BuildingComponentSublayerView | ||
Executes a Query against features in the layer view and returns a FeatureSet. | BuildingComponentSublayerView | ||
Executes a Query against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. | BuildingComponentSublayerView | ||
Removes a group of handles owned by the object. | Accessor |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
createQuery
createQuery(){Query}
-
Creates a query parameter object that can be used to fetch features as they are being displayed. It sets the query parameter's outFields property to
["*"]
and returnGeometry totrue
. The output spatial reference is set to the spatial reference of the view. The esri/layers/buildingSublayers/BuildingComponentSublayer.html#definitionExpression that currently applies to the sublayer view is also incorporated in the returned query object.ReturnsType Description Query The query object
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
Executes a Query against features in the layer view and returns the 3D Extent of features that satisfy the query. If query parameters are not provided, the extent and count of all loaded features are returned.
Read more about queries in the Query section of the BuildingSceneLayer class description.
To query for the extent of features directly from a Scene Service rather than those loaded for the current view, you must use the BuildingComponentSublayer.queryExtent() method.
For making attribute based queries on a BuildingComponentSublayerView you need to specify the required fields in the outFields property of the BuildingComponentSublayer to ensure that attribute values are available on the client for querying. You can use availableFields to inspect which fields are available on the client.
Known Limitations
- Spatial queries have the same limitations as those listed in the projection engine documentation.
- Spatial queries on BuildingComponentSublayerView use the Extent of the feature and not the footprint when calculating the spatial relationship with the query geometry. This means that a feature might be returned from the query, even though its footprint is not in a spatial relationship with the geometry.
- Currently only
intersects
,contains
, anddisjoint
spatialRelationships are supported on spatial queries. - Spatial queries are not currently supported if the BuildingComponentSublayerView has any of the following SpatialReferences:
- GDM 2000 (4742) - Malaysia
- Gsterberg (Ferro) (8042) - Austria/Czech Republic
- ISN2016 (8086) - Iceland
- SVY21 (4757) - Singapore
Parametersoptional Autocasts from ObjectSpecifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignaloptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortError
when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.ReturnsType Description Promise<object> When resolved, returns the extent and count of the features that satisfy the input query. See the object specification table below for details. Property Type Description count Number The number of features that satisfy the input query. extent Extent The extent of the features that satisfy the query.
-
Executes a Query against features in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all loaded features is returned.
To query for the count of features directly from a Scene Service rather than those loaded for the current view, you must use the BuildingComponentSublayer.queryFeatureCount() method.
For making attribute based queries on a BuildingSceneLayerView you need to specify the required fields in the outFields property of the BuildingComponentSublayer to ensure that attribute values are available on the client for querying. You can use availableFields to inspect which fields are available on the client. Read more about queries in the Query section of the BuildingSceneLayer class description.
Known Limitations
- Spatial queries have the same limitations as those listed in the projection engine documentation.
- Spatial queries on BuildingComponentSublayerView use the Extent of the feature and not the footprint when calculating the spatial relationship with the query geometry. This means that a feature might be returned from the query, even though its footprint is not in a spatial relationship with the geometry.
- Currently only
intersects
,contains
, anddisjoint
spatialRelationships are supported on spatial queries. - Spatial queries are not currently supported if the BuildingSceneLayerView has any of the following SpatialReferences:
- GDM 2000 (4742) - Malaysia
- Gsterberg (Ferro) (8042) - Austria/Czech Republic
- ISN2016 (8086) - Iceland
- SVY21 (4757) - Singapore
Parametersoptional Autocasts from ObjectSpecifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the
geometry
parameter in the query object to the view's extent.options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignaloptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortError
when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.Returns
-
queryFeatures
queryFeatures(query, options){Promise<FeatureSet>}
-
Executes a Query against features in the layer view and returns a FeatureSet. If query parameters are not provided, all loaded features are returned.
To execute a query against all the features in a Scene Service rather than only those loaded for the current view, you must use the BuildingComponentSublayer.queryFeatures() method.
For making attribute based queries on a BuildingComponentSublayerView you need to specify the required fields in the outFields property of the BuildingComponentSublayer to ensure that attribute values are available on the client for querying. You can use availableFields to inspect which fields are available on the client.
Known Limitations
- Spatial queries have the same limitations as those listed in the projection engine documentation.
- Spatial queries on BuildingComponentSublayerView use the Extent of the feature and not the footprint when calculating the spatial relationship with the query geometry. This means that a feature might be returned from the query, even though its footprint is not in a spatial relationship with the geometry.
- Currently only
intersects
,contains
, anddisjoint
spatialRelationships are supported on spatial queries. - Spatial queries are not currently supported if the BuildingSceneLayerView has any of the following SpatialReferences:
- GDM 2000 (4742) - Malaysia
- Gsterberg (Ferro) (8042) - Austria/Czech Republic
- ISN2016 (8086) - Iceland
- SVY21 (4757) - Singapore
Parametersoptional Autocasts from ObjectSpecifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned along with their attributes specified in availableFields. To only return features visible in the view, set the
geometry
parameter in the query object to the view's extent.options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignaloptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortError
when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.ReturnsType Description Promise<FeatureSet> When resolved, a FeatureSet is returned. The set will be empty if zero results are found.
-
Executes a Query against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all loaded features are returned.
To query for ObjectIDs of features directly from a Scene Service rather than those loaded for the current view, you must use the BuildingComponentSublayer.queryObjectIds() method.
For making attribute based queries on a BuildingSceneLayerView you need to specify the required fields in the outFields property of the BuildingComponentSublayer to ensure that attribute values are available on the client for querying. You can use availableFields to inspect which fields are available on the client.
Known Limitations
- Spatial queries have the limitations listed in the projection engine documentation.
- Spatial queries on BuildingSceneLayerView use the Extent of the feature and not the footprint when calculating the spatial relationship with the query geometry. This means that a feature might be returned from the query, even though its footprint is not in a spatial relationship with the geometry.
- Currently only
intersects
,contains
, anddisjoint
spatialRelationships are supported on spatial queries. - Spatial queries are not currently supported if the BuildingSceneLayerView has any of the following SpatialReferences:
- GDM 2000 (4742) - Malaysia
- Gsterberg (Ferro) (8042) - Austria/Czech Republic
- ISN2016 (8086) - Iceland
- SVY21 (4757) - Singapore
Parametersoptional Autocasts from ObjectSpecifies the attributes of the query. If query parameters are not provided, all loaded features are returned.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignaloptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortError
when an abort is signaled. See also AbortController for more information on how to construct a controller that can be used to deliver abort signals.Returns
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");