novorender-api-docs / DataJsAPI / API
Interface: API
Methods
createScene()
createScene(scene): Promise<object>
Create scene
Parameters
Parameter | Type | Description |
---|---|---|
scene | SceneDefinition | SceneDefinition |
Returns
Promise
<object
>
error?
optional error: string;
success?
optional success: boolean;
Remarks
Only administrator may reate a scene. Definition automatically saves to storage for future use.
Throws
Error in case of insufficient access rights.
deleteResource()
deleteResource(id): Promise<boolean>
Delete the specified resource from cloud storage.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The resource id (guid) |
Returns
Promise
<boolean
>
A boolean promise indicating when the operation is complete succesfully/failed.
Remarks
Only administrator may delete a resource.
Throws
Error in case of insufficient access rights.
deleteScene()
deleteScene(id): Promise<boolean>
Delete the specified scene from cloud storage.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The scene id (guid) |
Returns
Promise
<boolean
>
A boolean promise indicating when the operation is complete succesfully/failed.
Remarks
Only scene owners may delete a scene. The scene will be permanently lost and any references to it becomes invalid.
Throws
Error in case of insufficient access rights.
fetch()
fetch(path, init?): Promise<Response>
Relative custom path request
Parameters
Parameter | Type |
---|---|
path | string |
init ? | RequestInit |
Returns
Promise
<Response
>
getBookmarks()
getBookmarks(id, options?): Promise<Bookmark[]>
Parameters
Parameter | Type |
---|---|
id | string |
options ? | object |
options.group ? | string |
options.personal ? | boolean |
Returns
Promise
<Bookmark
[]>
getGroupIds()
getGroupIds(sceneId, id): Promise<number[]>
Parameters
Parameter | Type |
---|---|
sceneId | string |
id | string |
Returns
Promise
<number
[]>
getProcesses()
getProcesses(): Promise<readonly ActiveProcess[]>
Get list of active processes.
Returns
Promise
<readonly ActiveProcess
[]>
getProcessProgress()
getProcessProgress(
id,
position?,
signal?): Promise<ProcessProgress>
Get process progress
Parameters
Parameter | Type | Description |
---|---|---|
id | string | A process id |
position ? | number | A position returned by previous process progress |
signal ? | AbortSignal | - |
Returns
Promise
<ProcessProgress
>
State of process ProcessProgress
getResource()
getResource(id): Promise<ResourcePreview>
Get preview of the specified resource from cloud storage.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The scene id (guid) |
Returns
Promise
<ResourcePreview
>
Returns ResourcePreview
Remarks
Only administrator may access resources.
Throws
Error in case of insufficient access rights.
getResources()
getResources(): Promise<Resource[]>
Get list of available resources.
Returns
Promise
<Resource
[]>
Remarks
The list contains only those resources available to the currently authenticated user. Only administrator could access to resources.
getSceneDefinition()
getSceneDefinition(id): Promise<SceneDefinition>
Get saved scene definition using for createScene
Parameters
Parameter | Type |
---|---|
id | string |
Returns
Promise
<SceneDefinition
>
getScenes()
getScenes(): Promise<readonly ScenePreview[]>
Get list of available scenes.
Returns
Promise
<readonly ScenePreview
[]>
Remarks
The list contains only those scenes available to the currently authenticated user. For anonymous users, only public scenes are available.
getUserInformation()
getUserInformation(): Promise<object>
Get information about currently authenticated user
Returns
Promise
<object
>
features
features: any;
name
name: string;
organization
organization: string;
role
role: string;
getWKZones()
getWKZones(): string[]
Returns
string
[]
latLon2tm()
latLon2tm(coords, tmZone): vec3
Parameters
Parameter | Type |
---|---|
coords | GeoLocation |
tmZone | string |
Returns
vec3
loadScene()
loadScene(id): Promise<SceneData | SceneLoadFail>
Parameters
Parameter | Type |
---|---|
id | string |
Returns
Promise
<SceneData
| SceneLoadFail
>
putScene()
putScene(scene): Promise<boolean>
Parameters
Parameter | Type |
---|---|
scene | SceneData |
Returns
Promise
<boolean
>
saveBookmarks()
saveBookmarks(
id,
bookmarks,
options?): Promise<boolean>
Parameters
Parameter | Type |
---|---|
id | string |
bookmarks | Bookmark [] |
options ? | object |
options.group ? | string |
options.personal ? | boolean |
Returns
Promise
<boolean
>
tm2LatLon()
tm2LatLon(position, tmZone): GeoLocation
Parameters
Parameter | Type |
---|---|
position | vec3 |
tmZone | string |
Returns
GeoLocation
updateResource()
updateResource(resource): Promise<boolean>
Update the specified resource in cloud storage.
Parameters
Parameter | Type | Description |
---|---|---|
resource | Resource | The Resource |
Returns
Promise
<boolean
>
A boolean promise indicating when the operation is complete succesfully/failed.
Remarks
Only administrator may update a resource.
Throws
Error in case of insufficient access rights.
uploadResource()
uploadResource(
file,
progress,
revisionOf?,
path?,
split?): Promise<object>
Upload resource file
Parameters
Parameter | Type |
---|---|
file | File |
progress | (progress ) => void |
revisionOf ? | string |
path ? | string |
split ? | boolean |
Returns
Promise
<object
>
error?
optional error: string;
processId?
optional processId: string;