For documentation on the current version, please check Knowledge Base.
WebClient
Class WebClient implements the Orbit Web Client component.
By default, the CRS used by the API will be the Publication CRS. Photo locations, measurement results, etc will be expressed in this CRS. You can overrule this by calling the setCRS() function. After calling this function, coordinates returned by the API will always be expressed in this CRS, even when you close the publication and load another one. Call setCRS(null) to clear and return to the publication CRS.
License management
These functions are for managing the license context.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| setDeveloperId | 10.5.2 | id : <string> | Set the developer identification. | |
| setProductId | 10.5.2 | id : <string> | Set the product identification. | |
| checkLicense | 10.5.2 | Request a license lease. | ||
| closeLicense | 17.0.1 | Close the active license lease explicitly. Done automatically on browser close. | ||
| setLicenseServer | 11.1.0 | serverUrl : <string> | Set the license server that can provide an activation key. |
Login management
Showing the login panel can be triggered using the API. The login configuration can also be retrieved or set to allow for a consistent login experience between sessions.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| getLoginConfiguration | 11.1.0 | <string> | Get the login configuration data. Used whenever a configuration change occurs. |
|
| setLoginConfiguration | 11.1.0 | data : <string> | <void> | Set/Restore the login configuration data. Used when loading the component. |
| showLoginPanel | 11.1.0 | <void> | Brings up the login panel. |
Context
The following functions provide access to datatype-specific contexts.
Integration
These functions are useful to the integration context.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| getVersion | 10.5.2 | <string> | Returns the version of the component. | |
| getVersionDate | 11.0.3 | <string> | Returns the version of the component. | |
| setSize | 10.4.1 | width : <int> height : <int> | void | Set the component size. |
Loading a publication
The core function of the webclient component is to load a publication.
These functions are all about preparing to load, loading or closing a publication.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| setServer | 10.4.0 | url : <string> | void | Set the server location. |
| setCredentials | 10.4.0 | username : <string> password : <string> | void | Set the login credentials. |
| checkConnection | 10.5.2 | void | Check connectivity to the configured server. | |
| loadPublication | 10.4.0 | publicationName : <string> options : <object> 1) | void | Load a publication. The options argument is optional. |
| closePublication | 10.4.0 | void | Closes the current publication. | |
| applyPublicationStartup Parameters | 10.4.0 | void | Apply the startup parameters, stored in the publication description. A Publication must be loaded beforehand. |
|
| | 11.1.0 2) | <int> | Returns a request identifier. |
Manage layers
WKT layers can be managed using these functions.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| addWKTLayer | 10.4.0 3) | name : <string> wkt : <string> crs : <string> legendParameters : <legendparameters> attributeDefinitions : [ <attributedef>,…] attributeRows : [ <attributerow>,…] | <boolean> | Add a layer based on a WKT geometry. - name : The name of the layer. - wkt : The WKT describing the spatial objects. - crs : The spatial reference system of the wkt data. - legendParameters : The optional legend parameters to use when rendering. - attributeDefinitions : The optional list of attribute definitions that describe the attribute table. - attributeRows : The optional list of attribute rows, one per object. All objects are assumed to be of the same spatial type. Returns false when a layer with the given name already exists or WKT data is invalid. More info on WKT. |
| addWKTToWKTLayer | 10.4.0 4) | name : <string> wkt : <string> crs : <string> attributeRows : [ <attributerow>,…] | <boolean> | Add objects to an existing WKT layer. - name : The name of the layer. - wkt : The WKT describing the spatial objects. - crs : The spatial reference system of the wkt data. - attributeRows : The optional list of attribute rows, one per object. Returns false when the provided layer could not be found or the wkt data is invalid. More info on WKT. |
| clearWKTLayer | 17.0.1 | name : <string> | <boolean> | Remove all objects from a WKT layer. Returns true if the layer was found and cleared, false if not found. |
| removeLayer | 10.4.0 | name : <string> | <boolean> | Remove a layer. Returns true if the layer was found and removed, false if not found. |
| reloadLayer | 17.0.1 | name : <string> | <boolean> | Reload a layer with external data (like WFS). Returns true if the layer was found and reloaded, false if not found. |
| reloadAllLayers | 17.0.1 | <void> | Reloads all layers with external data (like WFS). |
Component settings
You can tweak the webclient component using these functions.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| getMapVisible | 10.5.2 | <boolean> | Returns the visiblity of the map. | |
| setMapVisible | 10.4.0 | visible : <boolean> | void | Set visiblity of the map. This function should be called after loading a publication. |
| getPanoramaVisible | 10.5.2 | <boolean> | Returns the visibility of the panorama. | |
| setPanoramaVisible | 10.4.0 | visible : <boolean> | void | Set visibility of the panorama. This function should be called after loading a publication. |
| getCopyMeasurementToClipboardVisible | 11.1.2 | <bool> | Get the visibility of the measurement copy-to-clipboard buttons. | |
| setCopyMeasurementToClipboardVisible | 11.1.2 | visibility : <bool> | <void> | Set the visibility of the measurement copy-to-clipboard buttons. This function should be called after loading a publication. |
| getSetting | 10.4.0 | name : <string> | <string> | Returns an application setting. |
| setSetting | 10.4.0 | name : <string> value : <string> | void | Set an application setting. |
CRS
By default the webclient operates using the Publication CRS. This is the CRS code defined when creating the publication. This means that measurements, photo positions and coverages returned by the API are all defined this CRS. Coordinates that are displayed in the UI are also displayed using this CRS.
The API user can choose to use a different CRS. Setting a CRS can allow for easier integration with the context application. Note that this also changes the CRS of coordinates presented in the UI.
To change the CRS of coordinates presented in the UI, use the setDisplayCRS function.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| getCRS | 10.5.2 | <string> | Get the CRS used by the webclient API. Returns the custom CRS or the publication CRS if no custom CRS was set using setCRS(). |
|
| setCRS | 10.5.2 | crs : <string> | void | Set the CRS the webclient uses. By default, this CRS is defined by the CRS of the loaded publication. Once you called this function, the client will ignore the publication CRS and always use this CRS. Call setCRS(null) to clear it and go back to using the publication CRS. Since version 10.5.2 this method can also be called while an publication is loaded. Versions before that can only call this method before opening a publication. |
| getDisplayCRS | 11.1.3 | <string> | Get the DisplayCRS used by the webclient. Returns the displayCRS or null in case no display CRS was explicitly set. |
|
| setDisplayCRS | 11.1.3 | crs : <string> | void | Set the CRS the webclient uses for presenting coordinates in the UI. Call setCRS(null) to clear it. |
| getPublicationCRS | 10.5.2 | <string> | Returns the CRS defined by the current publication. |
Object Selection
The following functions give access to the selected object.
| Function Name | Since | Arguments | Return Type | Description |
|---|---|---|---|---|
| getSelectedObject | 11.0.3 | <object> | Get the currently selected object (can be null) |
Events
The following events can be fired :
| Event Name | Since | Event Properties | Description |
|---|---|---|---|
| loadPublicationSuccess | 10.4.0 5) | publicationName : <string> | Fired when a publication was loaded succesfully. |
| loadPublicationFailure | 10.4.0 6) | fault : <fault> | Fired when a publication failed to be loaded. |
| loadPublicationListSuccess | 10.4.0 | list : [<string>,…] requestId : <int> | Fired when a request for available publications was succesful. The requestId property matches to an identifier returned by loadPublicationList. |
| loadPublicationListFailure | 10.4.0 | fault : <fault> requestId : <int> | Fired when a request for available publications failed. The requestId property matches to an identifier returned by loadPublicationList. |
| checkConnectionSuccess | 10.5.2 | Fired when a connection to the server was successful. | |
| checkConnectionFailure | 10.5.2 | fault : <fault> | Fired when a connection to the server failed. |
| closePublicationSuccess | 10.5.2 | publicationName : <string> | Fired when the publication is closed. |
| licenseGranted | 10.5.2 | statusCode : <string> licenseType : <string> licenseModules : [<string>,…] | Fired when the license is granted. The statusCode is guaranteed to be 'ok'. |
| licenseRevoked | 10.5.2 | statusCode : <string> | Fired when the license is revoked. |
| selectedObjectChanged | 11.0.3 | object : <object> | Fired when the selected object has changed. |
| loginConfigurationChanged | 11.1.0 | Fired when the login configuration changed. |