Skip to main content

Data JS API

DataJsAPI.API

Methods​

createScene​

â–¸ createScene(scene): Promise<{ error?: string ; success?: boolean }>

Create scene

Parameters​

NameTypeDescription
sceneSceneDefinitionSceneDefinition

Returns​

Promise<{ error?: string ; 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​

NameTypeDescription
idstringThe 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​

NameTypeDescription
idstringThe 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​

NameType
pathstring
init?RequestInit

Returns​

Promise<Response>


getBookmarks​

â–¸ getBookmarks(id, options?): Promise<Bookmark[]>

Parameters​

NameType
idstring
options?Object
options.group?string
options.personal?boolean

Returns​

Promise<Bookmark[]>


getGroupIds​

â–¸ getGroupIds(sceneId, id): Promise<number[]>

Parameters​

NameType
sceneIdstring
idstring

Returns​

Promise<number[]>


getProcessProgress​

â–¸ getProcessProgress(id, position?, signal?): Promise<ProcessProgress>

Get process progress

Parameters​

NameTypeDescription
idstringA process id
position?numberA position returned by previous process progress
signal?AbortSignal-

Returns​

Promise<ProcessProgress>

State of process ProcessProgress


getProcesses​

â–¸ getProcesses(): Promise<readonly ActiveProcess[]>

Get list of active processes.

Returns​

Promise<readonly ActiveProcess[]>


getResource​

â–¸ getResource(id): Promise<ResourcePreview>

Get preview of the specified resource from cloud storage.

Parameters​

NameTypeDescription
idstringThe 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​

NameType
idstring

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<{ features: any ; name: string ; organization: string ; role: string }>

Get information about currently authenticated user

Returns​

Promise<{ features: any ; name: string ; organization: string ; role: string }>


getWKZones​

â–¸ getWKZones(): string[]

Returns​

string[]


latLon2tm​

â–¸ latLon2tm(coords, tmZone): vec3

Parameters​

NameType
coordsGeoLocation
tmZonestring

Returns​

vec3


loadScene​

â–¸ loadScene(id): Promise<SceneData | SceneLoadFail>

Parameters​

NameType
idstring

Returns​

Promise<SceneData | SceneLoadFail>


putScene​

â–¸ putScene(scene): Promise<boolean>

Parameters​

NameType
sceneSceneData

Returns​

Promise<boolean>


saveBookmarks​

â–¸ saveBookmarks(id, bookmarks, options?): Promise<boolean>

Parameters​

NameType
idstring
bookmarksBookmark[]
options?Object
options.group?string
options.personal?boolean

Returns​

Promise<boolean>


tm2LatLon​

â–¸ tm2LatLon(position, tmZone): GeoLocation

Parameters​

NameType
positionvec3
tmZonestring

Returns​

GeoLocation


updateResource​

â–¸ updateResource(resource): Promise<boolean>

Update the specified resource in cloud storage.

Parameters​

NameTypeDescription
resourceResourceThe 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<{ error?: string ; processId?: string }>

Upload resource file

Parameters​

NameType
fileFile
progress(progress: number) => void
revisionOf?string
path?string
split?boolean

Returns​

Promise<{ error?: string ; processId?: string }>