create MethodStatic

Create a new ScreenViewport that shows a View of an iModel into an HTMLDivElement. This method will create a new HTMLCanvasElement as a child of the supplied parentDiv. It also creates two new child HTMLDivElements: one of class "overlay-decorators" for HTML overlay decorators, and one of class "overlay-tooltip" for ToolTips. All the new child HTMLElements are the same size as the parentDiv.

create(parentDiv: HTMLDivElement, view: ViewState): ScreenViewport

@note After creating a new ScreenViewport, you must call addViewport for it to become "live". You must also ensure you dispose of it properly.

@throws Error if parentDiv has zero width or height.

Parameter Type Description
parentDiv HTMLDivElement The HTMLDivElement to contain the ScreenViewport. The element must have non-zero width and height.
view ViewState The ViewState for the ScreenViewport.

Returns - ScreenViewport

Defined in

Last Updated: 14 November, 2024