Methods
Model

loadModel

Loads a model from a URL.

Example



Usage

JS


Parameters

url

URL to the model.

Type

Required

String

Yes

options

Options when loading the model.

Type

Required

Object

No

Properties

Name

Type

Required

Description

color

String or Number

No

Color used on objects

format

String

No

Valid value is gltf and modelType must be mesh

headers

Object

No

Map of headers to send with the request

initialState

String

No

Initial visibility state of the model

mapObjectId

Function

No

Function for mapping the object id to a custom id

modelId

String

No

Id of the model

modelType

String

No

Valids values are bim, meshor point-cloud

query

Object

No

Query to send with the request

transform

Object

No

Initial transform of the model

headers

Map of headers to send with the request.

Type

Map[String]

initialState

Initial visibility state of the model.

Valid values are:

  • hidden
  • visible

mapObjectId

Function for mapping the object id to a custom id.

Type

(modelId: String, objectId: String) => String

query

Query to send with the request.

Type

Map[Object]

transform

The initial transform of the model.

Name

Type

Required

Description

position

Vector3

No

Position to move to

rotation

Rotation

No

Rotation transform

scale

Vector3

No

Scale transform

Return Value

Promise that resolves to the model info for the loaded models.

Type

Promise => modelInfo: Object

modelInfo

Name

Type

Description

id

String

Id of the loaded model

boundingBox

Box3

Bounding box of the loaded model

originalBoundingBox

Box3

Bounding box without applying transform