DisplayStyleState Class
A DisplayStyle defines the parameters for 'styling' the contents of a ViewState.
Extends
Extended by
Implements
Methods
| Name | Description | |
|---|---|---|
| constructor(props: DisplayStyleProps, iModel: IModelConnection, source?: DisplayStyleState): DisplayStyleState | Construct a new DisplayStyleState from its JSON representation. | |
| attachMapLayer(options: { mapLayerIndex: MapLayerIndex, settings: MapLayerSettings }): void | Attach a map layer to display style. | |
| attachRealityModel(props: ContextRealityModelProps): ContextRealityModelState | Attach a ContextRealityModel to this display style. | |
| changeBackgroundMapProps(props: BackgroundMapProps): void | Modify a subset of the background map display settings. | |
| changeBackgroundMapProvider(props: BackgroundMapProviderProps): void | Change aspects of the BackgroundMapProvider from which background map imagery is obtained. | |
| changeBaseMapTransparency(transparency: number): void | Change the map base transparency as a number between 0 and 1. | |
| changeMapLayerCredentials(mapLayerIndex: MapLayerIndex, userName?: string, password?: string): void | Change the credentials for a map layer. | |
| changeMapLayerProps(props: Partial<MapLayerProps>, mapLayerIndex: MapLayerIndex): void | Modify a subset of a map layer settings. | |
| changeMapSubLayerProps(props: Partial<MapSubLayerProps>, subLayerId: SubLayerId, mapLayerIndex: MapLayerIndex): void | Modify a subset of a sub-layer settings. | |
| changeRenderTimeline(timelineId: string): Promise<void> | Change the Id of the RenderTimeline element that hosts the RenderSchedule.Script to be applied by this display style for | |
| commitScheduleEditing(): void | Finalizes a script editing session previously started with setScheduleEditing. | |
| detachMapLayerByIndex(mapLayerIndex: MapLayerIndex): void | Detach map layer at index (-1 to remove all layers) | |
| detachRealityModelByNameAndUrl(name: string, url: string): boolean | Detach the first ContextRealityModel that matches the specified name and url. | |
| dropSubCategoryOverride(id: string): void | Remove any SubCategoryOverride applied to a SubCategoryAppearance by this style. | |
| equalState(other: DisplayStyleState): boolean | Performs logical comparison against another display style. | |
| findMapLayerIndexByNameAndSource(name: string, source: string, isOverlay: boolean): number | Lookup a maplayer index by name and source. | |
| forEachRealityModel(func: (model: ContextRealityModelState) => void): void | Call a function for each reality model attached to this display style. | |
| getOSMBuildingRealityModel(): undefined | ContextRealityModelState | Get the ContextRealityModelState that displays the OpenStreetMap worldwide building layer, if enabled. | |
| getSubCategoryOverride(id: string): undefined | SubCategoryOverride | Obtain the overrides applied to a SubCategoryAppearance by this style. | |
| hasAttachedRealityModel(name: string, url: string): boolean | Return if a context reality model is attached. | |
| is3d(): this is DisplayStyle3dState | Returns true if this is a 3d display style. | |
| load(): Promise<void> | Ensures all of the data required by the display style is loaded. | |
| mapLayerAtIndex(mapLayerIndex: MapLayerIndex): undefined | MapLayerSettings | Return the map layer settings for a map layer at the provided index. | |
| moveMapLayerToBottom(mapLayerIndex: MapLayerIndex): void | Move map layer to bottom. | |
| moveMapLayerToIndex(fromIndex: number, toIndex: number, isOverlay: boolean): void | Reorder map layers | |
| moveMapLayerToTop(mapLayerIndex: MapLayerIndex): void | Move map layer to top. | |
| overrideSubCategory(id: string, ovr: SubCategoryOverride): void | Customize the way geometry belonging to a SubCategory is drawn by this display style. | |
| setOSMBuildingDisplay(options: OsmBuildingDisplayOptions): boolean | Set the display of the OpenStreetMap worldwide building layer in this display style by attaching or detaching the reality model displaying the buildings. | |
| setScheduleEditing(newScript: RenderSchedule.Script): void | Begins or updates a schedule script editing session for the current display style. |
Inherited methods
| Name | Inherited from | Description |
|---|---|---|
| clone(iModel?: IModelConnection): this Inherited | ElementState | Make an independent copy of this EntityState |
| equals(other: this): boolean Inherited | ElementState | Return true if this EntityState is equal to another one. |
| toJSON(): ElementProps Inherited | ElementState | Obtain this element's JSON representation. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| backgroundColor Accessor | ColorDef | The background color for this DisplayStyle | |
| backgroundColor Setter | backgroundColor(val: ColorDef): void | ||
| backgroundMapBase Accessor | BaseLayerSettings | Settings controlling how the base map is displayed within a view. | |
| backgroundMapBase Setter | backgroundMapBase(base: BaseLayerSettings): void | ||
| backgroundMapSettings Accessor | BackgroundMapSettings | The settings controlling how a background map is displayed within a view. | |
| backgroundMapSettings Setter | backgroundMapSettings(settings: BackgroundMapSettings): void | ||
| baseMapTransparency Accessor ReadOnly | number | Return map base transparency as a number between 0 and 1. | |
| className Accessor Static ReadOnly | string | The name of the BIS class associated with this class. | |
| contextRealityModelStates Accessor ReadOnly | ReadonlyArray<ContextRealityModelState> | ContextRealityModelStates attached to this display style. | |
| hasSubCategoryOverride Accessor ReadOnly | boolean | Returns true if an SubCategoryOverrides are defined by this style. | |
| monochromeColor Accessor | ColorDef | The color used to draw geometry in monochrome mode. | |
| monochromeColor Setter | monochromeColor(val: ColorDef): void | ||
| name Accessor ReadOnly | string | The name of this DisplayStyle | |
| onOSMBuildingDisplayChanged Readonly | BeEvent<(osmBuildingDisplayEnabled: boolean) => void> | Event raised just after setOSMBuildingDisplay changes the enabled state of the OSM buildings. | |
| onScheduleEditingChanged Readonly | BeEvent<(changes: RenderSchedule.EditingChanges[]) => void> | Event raised when schedule script edits are made, providing changed element IDs and the editing scope. | |
| onScheduleEditingCommitted Readonly | BeEvent<() => void> | Event raised when schedule script edits are committed (finalized). | |
| onScheduleScriptChanged Readonly | BeEvent<(newScript: RenderSchedule.Script) => void> | Event raised just before the scheduleScript property is changed. | |
| realityModels Accessor ReadOnly | Iterable<ContextRealityModelState, any, any> | Iterate over the reality models attached to this display style. | |
| scheduleScript Accessor | undefined | RenderSchedule.Script | The RenderSchedule.Script that animates the contents of the view, if any. | |
| scheduleScript Setter | scheduleScript(script: RenderSchedule.Script): void | ||
| settings Accessor Abstract ReadOnly | DisplayStyleSettings | The container for this display style's settings. | |
| viewFlags Accessor | ViewFlags | Flags controlling various aspects of the display style. | |
| viewFlags Setter | viewFlags(flags: ViewFlags): void | ||
| wantShadows Accessor ReadOnly | boolean | Returns true if solar shadow display is enabled by this display style. |
Inherited properties
| Name | Type | Inherited from | Description |
|---|---|---|---|
| classFullName Accessor Static Inherited ReadOnly | string | ElementState | Get full BIS class name of this Entity in the form "SchemaName:ClassName". |
| classFullName Readonly Inherited | string | ElementState | The full class name in the form "schema:class". |
| className Accessor Inherited ReadOnly | string | ElementState | The name of the BIS class associated with this class. |
| code Readonly Inherited | Code | ElementState | The Code for this element |
| federationGuid Readonly Inherited | string | undefined | ElementState | A FederationGuid assigned to this element by some other federated database |
| id Readonly Inherited | string | ElementState | The Id of this Entity. |
| iModel Readonly Inherited | IModelConnection | ElementState | The iModel from which this Entity was loaded |
| jsonProperties Readonly Inherited | [key: string]: any | ElementState | Optional json properties of this Entity. |
| model Readonly Inherited | string | ElementState | The ModelId of the Model containing this element |
| parent Readonly Inherited | RelatedElement | undefined | ElementState | The parent Element of this, or undefined if no parent. |
| schemaName Accessor Static Inherited ReadOnly | string | ElementState | The name of the BIS schema for this class. |
| userLabel Readonly Inherited | string | undefined | ElementState | A user-assigned label for this element. |
Defined in
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.