import BuildingComponentSublayer from "@arcgis/core/layers/buildingSublayers/BuildingComponentSublayer.js";
            const BuildingComponentSublayer = await $arcgis.import("@arcgis/core/layers/buildingSublayers/BuildingComponentSublayer.js");
            @arcgis/core/layers/buildingSublayers/BuildingComponentSublayer
        BuildingComponentSublayers contain 3D Object features representing building components like doors, pipes or AC units. They are sublayers in a BuildingSceneLayer either directly or as part of a BuildingGroupSublayer. This sublayer is similar to a 3D Object SceneLayer, it can be visualized with a specific renderer, popups can be customized using popupTemplate and SQL filters can be applied by setting a definitionExpression.
Starting with version 4.17, BuildingComponentSublayers support attribute or spatial queries if the the BuildingSceneLayer has an associated feature layer.
Property Overview
| Name | Type | Summary | Class | 
|---|---|---|---|
The name of the class.  | Accessor | ||
The SQL where clause used to filter features on the client.  | BuildingComponentSublayer | ||
An array of fields in the layer.  | BuildingComponentSublayer | ||
The name of a   | BuildingComponentSublayer | ||
The sublayer's layer id as defined by the Scene Service.  | BuildingSublayer | ||
Indicates if this sublayer is empty.  | BuildingSublayer | ||
Indicates how the layer should display in the LayerList widget.  | BuildingComponentSublayer | ||
The Error object returned if an error occurred while loading.  | BuildingComponentSublayer | ||
Represents the status of a load operation.  | BuildingComponentSublayer | ||
A list of warnings which occurred while loading.  | BuildingComponentSublayer | ||
The modelName is a standard name for each sublayer.  | BuildingSublayer | ||
The name of an   | BuildingComponentSublayer | ||
Opacity of the sublayer.  | BuildingSublayer | ||
An array of field names from the service to include with each feature.  | BuildingComponentSublayer | ||
Indicates whether to display popups when features in the layer are clicked.  | BuildingComponentSublayer | ||
The popup template for the sublayer.  | BuildingComponentSublayer | ||
The renderer assigned to the sublayer.  | BuildingComponentSublayer | ||
The title of the sublayer used to identify it in places such as the LayerList and Legend.  | BuildingSublayer | ||
| For BuildingComponentSublayer the type is always "building-component". | BuildingComponentSublayer | ||
An automatically generated unique identifier assigned to the instance.  | BuildingSublayer | ||
Indicates if the sublayer is visible in the view.  | BuildingSublayer | 
Property Details
- 
  
    
The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the View. Setting a definition expression is useful when only a subset of the data in the layer should be displayed.
Setting the definition expression of a layer automatically updates all layer views.
If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression.
Note that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. This means that all features need to be downloaded for filter evaluation.
This property is evaluated on the client using the cached attributes and it only supports standardized SQL.
 
- 
  
  
  
  
  
  
  
    
Since: ArcGIS Maps SDK for JavaScript 4.33BuildingComponentSublayer since 4.10, fields added at 4.33.  - 
  
    
An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer.
 
- 
  
  
id
InheritedPropertyid NumberreadonlyInherited from BuildingSublayer - 
  
    
The sublayer's layer id as defined by the Scene Service.
 
- 
  
  
  
  Inherited from BuildingSublayer
 - 
  
    
Indicates if this sublayer is empty. This property is only read from the service. Empty sublayers are not loaded for rendering and applications can choose to hide them in their UI.
 
- 
  
  
listMode
PropertylistMode StringSince: ArcGIS Maps SDK for JavaScript 4.11BuildingComponentSublayer since 4.10, listMode added at 4.11.  - 
  
    
Indicates how the layer should display in the LayerList widget. The possible values are listed below.
Value Description show The layer is visible in the table of contents. hide The layer is hidden in the table of contents. Possible Values:"show" |"hide"
- Default Value:"show"
 
 
- 
  
    
The Error object returned if an error occurred while loading.
- Default Value:null
 
 
- 
  
  
loadStatus
PropertyloadStatus Stringreadonly - 
  
    
Represents the status of a load operation.
Value Description not-loaded The object's resources have not loaded. loading The object's resources are currently loading. loaded The object's resources have loaded without errors. failed The object's resources failed to load. See loadError for more details. Possible Values:"not-loaded" |"loading" |"failed" |"loaded"
- Default Value:"not-loaded"
 
 
- 
  
    
A list of warnings which occurred while loading.
 
- 
  
  
  
  Inherited from BuildingSublayer
 - 
  
    
The modelName is a standard name for each sublayer. For example the sublayer containing the doors in a building has the modelName "Doors". Use this property to retrieve sublayers in a BuildingSceneLayer.
Example// use modelName to identify a sublayer const doorslayer = buildingSceneLayer.allSublayers.find(function(sublayer) { return sublayer.modelName === "Doors"; }); 
- 
  
  
opacity
InheritedPropertyopacity NumberInherited from BuildingSublayer - 
  
    
Opacity of the sublayer.
- Default Value:1
 
 
- 
  
  
  
  
  
  
  
    
Since: ArcGIS Maps SDK for JavaScript 4.12BuildingComponentSublayer since 4.10, outFields added at 4.12.  - 
  
    
An array of field names from the service to include with each feature. To fetch the values from all fields in the layer, use
["*"]. Fields specified inoutFieldswill be requested alongside with required fields for rendering.To include fields in all sublayers, use the outFields property of the parent layer.
- Default Value:null
 
 
- 
  
  
popupEnabled
PropertypopupEnabled Boolean - 
  
    
Indicates whether to display popups when features in the layer are clicked. The layer needs to have a popupTemplate to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if Popup.defaultPopupTemplateEnabled is set to
true.- Default Value:true
 - See also
 
 
- 
  
  
popupTemplate
PropertypopupTemplate PopupTemplate |null |undefinedautocast - 
  
    
The popup template for the sublayer. When set, the
popupTemplateallows users to access attributes and display their values in the view's Popup when a feature is selected using text and/or charts. See the PopupTemplate sample for an example of how PopupTemplate interacts with a FeatureLayer. Setting a PopupTemplate on this layer type is done in the same way as a FeatureLayer.A default popup template is automatically used if no
popupTemplatehas been defined when Popup.defaultPopupTemplateEnabled is set totrue.- See also
 
 
- 
  
  
renderer
Propertyrenderer RendererUnion |null |undefinedautocast - 
  
    
The renderer assigned to the sublayer. The renderer defines how to visualize each feature in the sublayer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions.
Example// all features in the layer will be visualized with // a blue color sublayer.renderer = { type: "simple", // autocasts as new SimpleRenderer() symbol: { type: "mesh-3d", // autocasts as new MeshSymbol3D() symbolLayers: [{ type: "fill", // autocasts as new FillSymbol3DLayer() material: { color: "blue" } }] } }; 
- 
  
  
  
  Inherited from BuildingSublayer
 - 
  
    
  
  
  
 
- 
  
  
type
Propertytype Stringreadonly - 
  
  
    
For BuildingComponentSublayer the type is always "building-component".
 
- 
  
  
uid
InheritedPropertyuid StringreadonlyInherited from BuildingSublayerSince: ArcGIS Maps SDK for JavaScript 4.33BuildingSublayer since 4.10, uid added at 4.33.  - 
  
    
An automatically generated unique identifier assigned to the instance. The unique id is generated each time the application is loaded.
 
- 
  
  
visible
InheritedPropertyvisible BooleanInherited from BuildingSublayer - 
  
    
Indicates if the sublayer is visible in the view.
- Default Value:true
 
 
Method Overview
| Name | Return Type | Summary | Class | 
|---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object.  | Accessor | ||
Cancels a load() operation if it is already in progress.  | BuildingComponentSublayer | ||
Creates a default popup template for the layer, populated with all the fields of the layer.  | BuildingComponentSublayer | ||
Creates a query object that can be used to fetch features that satisfy the component sublayer's current definition expression.  | BuildingComponentSublayer | ||
Returns the Field instance for a field name (case-insensitive).  | BuildingComponentSublayer | ||
Returns the Domain associated with the given field name.  | BuildingComponentSublayer | ||
Gets field usage information.  | BuildingComponentSublayer | ||
Returns true if a named group of handles exist.  | Accessor | ||
  | BuildingComponentSublayer | ||
  | BuildingComponentSublayer | ||
  | BuildingComponentSublayer | ||
Promise  | Loads the resources referenced by this class.  | BuildingComponentSublayer | |
Promise<Object>  | Executes a Query against the associated feature service and returns the 2D Extent of features that satisfy the query.  | BuildingComponentSublayer | |
Promise<Number>  | Executes a Query against the associated feature service and returns the number of features that satisfy the query.  | BuildingComponentSublayer | |
Promise<FeatureSet>  | Executes a Query against the associated feature service and returns a FeatureSet.  | BuildingComponentSublayer | |
Executes a Query against the associated feature service and returns an array of ObjectIDs of the features that satisfy the input query.  | BuildingComponentSublayer | ||
Removes a group of handles owned by the object.  | Accessor | ||
Promise  | 
  | BuildingComponentSublayer | 
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.
 
- 
  
  
    
Cancels a load() operation if it is already in progress.
 
- 
  
  
createPopupTemplate
MethodcreatePopupTemplate(options){PopupTemplate |null |undefined}Since: ArcGIS Maps SDK for JavaScript 4.11BuildingComponentSublayer since 4.10, createPopupTemplate added at 4.11.  - 
  
  
    
Creates a default popup template for the layer, populated with all the fields of the layer.
Parameteroptions CreatePopupTemplateOptionsoptionalOptions for creating the popup template.
ReturnsType Description PopupTemplate | null | undefined The popup template, or nullif the layer does not have any fields. 
- 
  
  
createQuery
MethodcreateQuery(){Query}Since: ArcGIS Maps SDK for JavaScript 4.17BuildingComponentSublayer since 4.10, createQuery added at 4.17.  - 
  
  
    
Creates a query object that can be used to fetch features that satisfy the component sublayer's current definition expression. The query should only be used on the layer and not on the layer view.
ReturnsType Description Query The query object representing the layer's definition expression.  
- 
  
  
  
  
  
    
Since: ArcGIS Maps SDK for JavaScript 4.12BuildingComponentSublayer since 4.10, getFieldDomain added at 4.12.  - 
  
  
    
Returns the Domain associated with the given field name. The domain can be either a CodedValueDomain or RangeDomain.
ParametersReturns 
- 
  
  
getFieldUsageInfo
MethodgetFieldUsageInfo(fieldName){Object}Since: ArcGIS Maps SDK for JavaScript 4.17.BuildingComponentSublayer since 4.10, getFieldUsageInfo added at 4.17..  - 
  
  
    
Gets field usage information. On building component sub layers, fields can always be used for rendering and popups. Fields can only be used for querying if an associated feature service is available.
The returned object contains the following usage information:
Property Type Description supportsRenderer boolean Indicates that a field can be used in a renderer (e.g. in visual variables), see renderer. supportsLabelingInfo boolean This is always false, labeling is not supported on BuildingSceneLayer.supportsPopupTemplate boolean Indicates that a field can be used in a popup template, see popupTemplate. supportsLayerQuery boolean Indicates that a field can be used in layer queries, see queryFeatures(). ParameterfieldName StringThe name of the field to get usage info for.
ReturnsType Description Object the field usage  
- 
  
  
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 trueif 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"); } 
- 
  
  
isFulfilled
MethodisFulfilled(){Boolean} - 
  
  
    
isFulfilled()may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled,truewill be returned.ReturnsType Description Boolean Indicates whether creating an instance of the class has been fulfilled (either resolved or rejected).  
- 
  
  
    
Loads the resources referenced by this class. This method automatically executes for a View and all of the resources it references in Map if the view is constructed with a map instance.
This method must be called by the developer when accessing a resource that will not be loaded in a View.
The
load()method only triggers the loading of the resource the first time it is called. The subsequent calls return the same promise.It's possible to provide a
signalto stop being interested into aLoadableinstance load status. When the signal is aborted, the instance does not stop its loading process, only cancelLoad can abort it.Parametersoptional Additional options.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen 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 Resolves when the resources have loaded.  
- 
  
  
queryExtent
MethodqueryExtent(query, options){Promise<Object>}Since: ArcGIS Maps SDK for JavaScript 4.17BuildingComponentSublayer since 4.10, queryExtent added at 4.17.  - 
  
  
    
Executes a Query against the associated feature service and returns the 2D Extent of features that satisfy the query. At the moment the 3D Extent can be returned by using BuildingComponentSublayerView.queryExtent(), but this will return the 3D extent only for features currently in the view. The query succeeds only if the BuildingSceneLayer has an associated feature layer. If an associated feature layer is not available, then an error with the name
buildingscenelayer:query-not-availableis thrown. Read more about queries in the Querying section of the BuildingSceneLayer class description.Parametersoptional Autocasts from ObjectSpecifies the query parameters.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen 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.  
- 
  
  
queryFeatureCount
MethodqueryFeatureCount(query, options){Promise<Number>}Since: ArcGIS Maps SDK for JavaScript 4.17BuildingComponentSublayer since 4.10, queryFeatureCount added at 4.17.  - 
  
  
    
Executes a Query against the associated feature service and returns the number of features that satisfy the query. The query succeeds only if the layer's
supportsLayerQuerycapability is enabled. Use the getFieldUsageInfo() method to check if the layer supports queries. If querying is not enabled, then an error with the namebuildingscenelayer:query-not-availableis thrown. Read more about queries in the Querying section of the BuildingSceneLayer class description.Parametersoptional Autocasts from ObjectSpecifies the query parameters.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen 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<Number> Resolves to the count of the features satisfying the query.  
- 
  
  
queryFeatures
MethodqueryFeatures(query, options){Promise<FeatureSet>}Since: ArcGIS Maps SDK for JavaScript 4.17BuildingComponentSublayer since 4.10, queryFeatures added at 4.17.  - 
  
  
    
Executes a Query against the associated feature service and returns a FeatureSet. The query succeeds only if the layer's
supportsLayerQuerycapability is enabled. Use the getFieldUsageInfo() method to check if the layer supports queries. If querying is not enabled, then an error with the namebuildingscenelayer:query-not-availableis thrown. Read more about queries in the Querying section of the BuildingSceneLayer class description.Parametersoptional Autocasts from ObjectSpecifies the query parameters.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen 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> Resolves to a FeatureSet which contains the features satisfying the query.  
- 
  
  
  
  
  
    
Since: ArcGIS Maps SDK for JavaScript 4.17BuildingComponentSublayer since 4.10, queryObjectIds added at 4.17.  - 
  
  
    
Executes a Query against the associated feature service and returns an array of ObjectIDs of the features that satisfy the input query. The query succeeds only if the layer's
supportsLayerQuerycapability is enabled. Use the getFieldUsageInfo() method to check if the layer supports queries. If querying is not enabled, then an error with the namebuildingscenelayer:query-not-availableis thrown. Read more about queries in the Querying section of the SceneLayer class description.Parametersoptional Autocasts from ObjectSpecifies the query parameters.
options ObjectoptionalAn object with the following properties.
Specificationsignal AbortSignal|null|undefinedoptionalSignal object that can be used to abort the asynchronous task. The returned promise will be rejected with an Error named
AbortErrorwhen 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- See also
 
 
- 
  
  
  
  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"); 
- 
  
  
    
when()may be leveraged once an instance of the class is created. This method takes two input parameters: aonFulfilledfunction and anonRejectedfunction. TheonFulfilledexecutes when the instance of the class loads. TheonRejectedexecutes if the instance of the class fails to load.ParametersReturnsType Description Promise Returns a new promise for the result of onFulfilledthat may be used to chain additional functions.Example// Although this example uses MapView, any class instance that is a promise may use when() in the same way let view = new MapView(); view.when(function(){ // This function will execute once the promise is resolved }, function(error){ // This function will execute if the promise is rejected due to an error });