BuildingComponentSublayer
esri/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 filters can be applied by setting a definitionExpression.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The name of the class. more details | more details | Accessor | |
String | The SQL where clause used to filter features on the client. more details | more details | BuildingComponentSublayer | |
Number | The sublayer's layer id as defined by the Scene Service. more details | more details | BuildingSublayer | |
Error | The Error object returned if an error occurred while loading. more details | more details | BuildingComponentSublayer | |
String | Represents the status of a load operation. more details | more details | BuildingComponentSublayer | |
Object[] | A list of warnings which occurred while loading. more details | more details | BuildingComponentSublayer | |
String | The modelName is a standard name for each sublayer. more details | more details | BuildingSublayer | |
Number | Opacity of the sublayer. more details | more details | BuildingSublayer | |
Boolean | Indicates whether to display popups when features in the layer are clicked. more details | more details | BuildingComponentSublayer | |
PopupTemplate | The popup template for the sublayer. more details | more details | BuildingComponentSublayer | |
Renderer | The renderer assigned to the sublayer. more details | more details | BuildingComponentSublayer | |
String | The title of the sublayer used to identify it in places such as the LayerList and Legend widgets. more details | more details | BuildingSublayer | |
String | The type for this sublayer is always | more details | BuildingComponentSublayer | |
Boolean | Indicates if the sublayer is visible in the view. more details | more details | BuildingSublayer |
Property Details
The name of the class. The declared class name is formatted as
esri.folder.className
.
- definitionExpressionString
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.
Important to note is 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. As a result all features need to be downloaded always for filter evaluation.
This property is evaluated on the client using the cached attributes and it only supports standardized SQL.
The sublayer's layer id as defined by the Scene Service.
- loadErrorErrorreadonly
The Error object returned if an error occurred while loading.
- Default Value:null
- loadStatusStringreadonly
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. - Default Value:not-loaded
- loadWarningsObject[]readonly
A list of warnings which occurred while loading.
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 of the sublayer.
- Default Value:1
- popupEnabledBoolean
Indicates whether to display popups when features in the layer are clicked.
- Default Value:true
- popupTemplatePopupTemplateautocast
The popup template for the sublayer. When set, the
popupTemplate
allows 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.
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.
- See also:
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" } }] } };
- typeStringreadonly
The type for this sublayer is always
building-component
.
Indicates if the sublayer is visible in the view.
- Default Value:true
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
Cancels a load() operation if it is already in progress. more details | more details | BuildingComponentSublayer | ||
Boolean |
| more details | BuildingComponentSublayer | |
Boolean |
| more details | BuildingComponentSublayer | |
Boolean |
| more details | BuildingComponentSublayer | |
Promise | Loads the resources referenced by this class. more details | more details | BuildingComponentSublayer | |
Promise |
| more details | BuildingComponentSublayer |
Method Details
- cancelLoad()
Cancels a load() operation if it is already in progress.
- isFulfilled(){Boolean}
isFulfilled()
may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled,true
will be returned.Returns:Type Description Boolean Indicates whether creating an instance of the class has been fulfilled (either resolved or rejected).
- isRejected(){Boolean}
isRejected()
may be used to verify if creating an instance of the class is rejected. If it is rejected,true
will be returned.Returns:Type Description Boolean Indicates whether creating an instance of the class has been rejected.
- isResolved(){Boolean}
isResolved()
may be used to verify if creating an instance of the class is resolved. If it is resolved,true
will be returned.Returns:Type Description Boolean Indicates whether creating an instance of the class has been resolved.
- load(){Promise}
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.
Returns:Type Description Promise Resolves when the resources have loaded.
- when(callback, errback){Promise}
when()
may be leveraged once an instance of the class is created. This method takes two input parameters: acallback
function and anerrback
function. Thecallback
executes when the instance of the class loads. Theerrback
executes if the instance of the class fails to load.Parameters:callback FunctionoptionalThe function to call when the promise resolves.
errback FunctionoptionalThe function to execute when the promise fails.
Returns:Type Description Promise Returns a new promise for the result of callback
that may be used to chain additional functions.Example:// Although this example uses MapView, any class instance that is a promise may use then() in the same way var 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 });