Skip to main content
Version: v4.6

IafGraphicsSvc

cacheGraphicsFiles#

Request the Graphics Service to cache a graphics file in its file store for streaming later.

ParameterRequiredTypeDescription
filesYesundefined
ctxYesCtxcontext
Returns

Promise<String> - ok: 204 response

Examples
let files = [  {    "_fileId": "da9a12ac-699c-4232-8c06-fc789eb9d6e5"  },  {    "_fileId": "aa51b6b9-8c61-4bea-a5bf-66fd4d423f9e",    "_fileVersionId": "81266d27-7fb6-4c80-bf3c-77038ffdbfd7"  }]await IafGraphicsSvc.cacheGraphicsFiles(files, ctx);

createFileSet#

Creates a GraphicsFileSet with a list of GraphicsFiles. The files in the GraphicsFileSet will be available for streaming in a single Iaf-Viewer session. The _id of the returned GraphicsFileSet should be provided to the Iaf-Viewer to setup the websocket connection for streaming geometry. A GraphicsFileSet can be used only by the user who created it. A GraphicsFileSet will be removed after the websocket connection is terminated.

ParameterRequiredTypeDescription
fileSetYesGraphicsFileSetGraphicsFileSet containing a list of GraphicsFiles that should be made available for an Iaf-Viewer session.
ctxYesCtxContext storage that contains data, such as authorization token requirements, namespaces, or session storage.
Returns

GraphicsFileSet - created: 201 response. The returned GraphicsFileSet contains an _id which should be passed to the Iaf-Viewer for setting up a session. The returned GraphicsFileSet will contain all or a sub-set of the input GraphicsFiles depending on which files exist in the File Service and to which files the user has READ access.

Examples
let fileSet = { files = [   {     _fileId: "da9a12ac-699c-4232-8c06-fc789eb9d6e5"   },   {     _fileId: "aa51b6b9-8c61-4bea-a5bf-66fd4d423f9e",     _fileVersionId: "81266d27-7fb6-4c80-bf3c-77038ffdbfd7"   } ]};
let severFileSet = IafGraphicsSvc.createFileSet(files, ctx);

createGraphicsData#

Creates graphics data object with specified properties for rendering in a 3D viewer.

ParameterRequiredTypeDescription
ctxYesCtxContext containing session or authorization details, with nsfilter as part of the namespace filtering.
dataYesArrayAn array of markup objects, each containing points, type, viewerType, and styleConfig.
Returns

Promise<Object> - Response data from the graphics service.

Examples
let data = [  {"_type": "markup","_properties": {      points: [        { x: -10026.515145147227, y: -8477.090905149831, z: 23920.00041471026 },        { x: -3465.221490438962, y: -26919.918005364816, z: 23920.00041496129 }      ],      type: 'LINE',      viewerType: '3D',      styleConfig: {  }    }  }];
let response = await IafGraphicsSvc.createGraphicsData(data, ctx);

deleteGraphicsData#

Deletes graphics data object by ID.

ParameterRequiredTypeDescription
ctxYesCtxContext containing session or authorization details.
idsYesundefined
idYesStringThe ID of the markup item to delete.
Returns

Promise<void> - A confirmation of deletion from the graphics service.

getLayersList#

Get the desired list of layers for a BIM Model.

ParameterRequiredTypeDescription
ctxYesCtxcontext
Returns

Promise<String> - ok: 204 response

Examples
let layers = await IafGraphicsSvc.getLayersList();

getMapboxToken#

Fetch the Mapbox access token.

ParameterRequiredTypeDescription
ctxYesCtxcontext
Returns

Promise<String> - The Mapbox access token.

Examples
let token = await IafGraphicsSvc.getMapboxToken(ctx);

getStatus#

Get the status of graphics service.

ParameterRequiredTypeDescription
ctxYesCtxcontext
Returns

Promise<String> - ok: 204 response

Examples
let status = await IafGraphicsSvc.getStatus();

logMapbox#

Logs a message to the Mapbox logging service.

ParameterRequiredTypeDescription
levelYesstringThe log level (e.g., 'error', 'warning', 'info').
messageYesstringThe message to log.
ctxYesObjectThe context that contains session or authorization details.
Returns

Promise<Object> - The response from the Mapbox logging service.

readGraphicsDataById#

Reads graphics data object by ID.

ParameterRequiredTypeDescription
ctxYesCtxContext containing session or authorization details.
idYesStringThe ID of the markup item to retrieve.
Returns

Promise<Object> - The markup item data from the graphics service.

readGraphicsDataByType#

Retrieves a list of markups filtered by from the Graphics Service.

ParameterRequiredTypeDescription
ctxYesCtxContext containing session or authorization details, with nsfilter as part of the namespace filtering.
typeYesundefined
$2YesObject
Returns

Promise<Object> - Response data from the graphics service.

Examples
let response = await IafGraphicsSvc.readGraphicsDataByIds(ctx);

updateGraphicsDataById#

Updates graphics data object by ID with new properties.

ParameterRequiredTypeDescription
ctxYesCtxContext containing session or authorization details.
idYesStringThe ID of the markup item to update.
dataYesObjectThe updated data for the markup item.
Returns

Promise<Object> - The updated markup item data from the graphics service.