loadModelsFromToken
Loads models from a viewer token.
Example
Usage
const options = {
modelId: "my-model-id"
};
const url = "https://api.catenda.com/v2/projects/{PROJECT_ID}/viewer3d/data?token={TOKEN}";
const modelInfoPromise = viewer3d.loadModelsFromToken(url, options);Parameters
url
Viewer token url.
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 |
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 |
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.
Return Value
Promise that resolves to the model info for the loaded models.
Type |
|---|
Promise => modelInfo: Object |
modelInfo