NAV Navigation

Deprecation notice

We are unifying all our APIs under one host, We'll be updating the docs in the coming days to reflect the new URL mappings. Existing URLs pointing to or will continue to work until the sunset date of June 1st 2025.

The old -> new mappings by API are as follows:

Viewer Widget API v1.0

Getting started

The Viewer Widget API allows developers to add predefined widgets

to their viewer app.


Viewer Widget API requires jQuery 1.x to run.


Viewer Widget API can either be automatically initialized by using the DOM data API or manually initialized in JavaScript.


Add viewer framework

 <script type="text/javascript" src=""></script>

Create a viewer instance

<div data-viewer="webgl" data-url=""
  1. Create a viewer access token by using the POST v2/projects/:project/viewer3d/token resources in the Catenda REST API.

  2. Add the viewer framework to you application:

  3. Create a viewer instance, and add the data attribute data-ui.


Create a DIV container

<div id="viewer-container">
    <div id="viewer"></div>

Viewer-2d integration with the storey select enabled

<!-- If you are using the viewer-2d integration with the storey-select enabled, be sure to put the viewer-2d element in a container as well. -->

<div id="viewer-2d-container">
    <div id="viewer-2d"></div>

Follow the below snippet to initialize

<script type="text/javascript" src=""></script>
// Include viewer 2D script if 2D is used
<script type="text/javascript" src=""></script>
<script type="text/javascript">
    var loadedViewers = 0;

    // When loading the Viewer API, include a parameter ['viewer-ui']

    // Callback that loads a viewer access token URL and initializes the UI widget
    function viewerLoaded() {
        if (++loadedViewers < 2) {

        //Load the 3D geometry 
        const url3d = '';
        $('#viewer').viewer('loadUrl', url3d);

        // Load the 2D geometry 
        const url2d = '';
        $('#viewer-2d').viewer2d('loadUrl', url2d);

        // Initialize the viewer UI widget with desired options
            enableJoystick: true,
            joystickHidden: false,
            enableContextMenu: true,
            viewer2dId: 'viewer-2d',
            enableViewer2dIntegration: true,
            showViewer2dStoreySelect: true
            // ...
  1. Create a viewer access token by using the POST v2/projects/:project/viewer3d/token resources in the Catenda REST API.

  2. Create a DIV container element which will contain the viewer element. If you are not using the joystick navigation, you can skip the container.

If you are using the viewer-2d integration with the storey select enabled, be sure to put the viewer-2d element in a container as well.


var options = {
    enableKeyboard: Boolean,            // Default false
    enableJoystick: Boolean,            // Default true
    joystickHidden: Boolean,            // Default true
    joystickColor: String,              // Default 'blue', accepts any valid CSS color
    joystickPosition: String,           // Default 'bottom-center'.
    joystickRotationClamp: Number,      // Default 2, rotation speed is divided by this number
    joystickBorderOffset: String,       // Default '20px', accepts any valid CSS style
    joystickSize: Integer,              // Default 100, size in px
    spacesVisible: Boolean,             // Default false, note that you have to use the setSpaces method for this to work
    viewer2dId: String,                 // Default null
    enableViewer2dIntegration: Boolean, // Default false
    showViewer2dStoreySelect: Boolean   // Default false
    enableContextMenu: Boolean,         // Default false
    translations: Object                // Default { showAll: "Show all", hide: "Hide", hideOthers: "Hide others", makeTranslucent: "Make translucent", isolate: "Isolate", lookAt: "Look at", removeClippingPlanes: "Remove Clipping Planes", addClippingPlane: "Add clipping plane", sectionTopAndBottom: "Section top and bottom", noModelsLoaded: "No models loaded.", loading: "Loading...", defaultBuildingName: "(unknown building)", defaultModelName: "(unknown model)" }


This enables keyboard shortcuts and navigation in the viewer.


g               : show
shift + g, o    : show all
h               : hide
del             : remove selected clipping plane, or hide selected 
shift + h       : hide others
t               : make translucent
shift + t, i    : make others translucent
l               : look at


w, up           : move foreward
s, down         : move backward
a, left         : move left
d, right        : move right
x, shift + up   : move up
c, shift + down : move down
q, ins          : rotate left
e, home         : rotate right
r, pageup       : rotate up
f, pagedown     : rotate down


Enables joystick navigation. The joystick can be used to navigate in the viewer on touch screens, or with the mouse.


Wheter the joystick should be default hidden or not.


The color of the joystick widget. Any valid CSS color should work.


The default position of the joystick. Possible values: 'middle-left', 'bottom-left', 'bottom-center', 'bottom-right', 'middle-right'


The rotation speed is originally set using the $('.viewer').viewer('rotationspeed', 50.0); method. To use a different rotation speed when navigating with the joystick, this number can be set to something other than 1. The base rotation speed when navigating with the joystick will be the viewers rotation speed divided by this number.


Used to adjust the position the joystick, i.e. move it a bit farther from the border.


The px size of the joystick widget. Defaults to 100


Wheter or not spaces should be shown. To get this to work you have to use the setSpaces method first to let the widget know the ids of the spaces. If spacesVisible is set to false, spaces will be hidden, and remain hidden when the user triggers a show all event.

For an example of how to find the spaces in the first place, see the setSpaces method below.


If you want to enable viewer-2d integration, you have to specify the id of the viewer-2d element.


Enables the 2d - 3d integration when it is set to true.

Note: you also have to specify the id of the 2d-viewer element.


If this is set to true, a storey dropup will be added to the 2d-container.

Note: you also have to specify the id of the 2d-viewer element.


When enabled, a dropdown menu should appear when right-clicking in the viewer. From the context menu you should be able to show, hide, make translucent and add/remove clipping planes.


Translate the context menu.

// Example norwegian translation:
    // ...
    enableContextMenu: true,
    translations: {
        showAll: "Vis alle",
        hide: "Skjul",
        hideOthers: "Skjul andre",
        makeTranslucent: "Sett gjennomsiktig",
        isolate: "Isoler",
        lookAt: "Se på",
        removeClippingPlanes: "Fjern klippeplan",
        addClippingPlane: "Legg til klippeplan",
        sectionTopAndBottom: "Klipp top og bunn"


All methods are invoked by calling the method viewerUI on the result of a jQuery/$ function call. The first argument to the viewerUI method must be the method name.


Shows the joystick. Joystick must be enabled for this to work.

Parameters: None


Hides the joystick

Parameters: None


Sets the position of the joystick.



Updates the options, and redraws the joystick.




    "type": [ "IfcSpace" ]

By default the viewer will display spaces. If you want to hide the spaces, and make sure they remain hidden when you trigger a show all event, you can use this method to let the viewer know the objectIds of the spaces. You also have to make sure the showSpaces option is set to false.

To find the spaces you may use Query /ifc/products resources in the Catenda REST API with the type options set to "IfcSpace":

This will return an Array of IfcSpace objects, extract all the objectId values and put them in an array. Use the array as input in this method.



Sets the spacesVisible option. If true spaces will be shown, if false spaces will be hidden even when a show all event is triggered.



If 2d integration is activated, this will lock the cursor of the 2d-viewer in the center of the 2d-viewer.



If 2d integration is activated and the storey select is shown, this will make sure that the selected 2d storey do not change when navigating in 3d.