Getting Started
  • 13 Mar 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Getting Started

  • Dark
    Light
  • PDF

Article summary

Confirming your NavVis IVION Version

Procedure

  1. On the NavVis IVION Instance dashboard, click the hamburger icon in the top left corner of your screen.

  2. Click About in the bottom left corner of your screen.

The box that opens will show which version of NavVis IVION you are currently running.

Setting Up

Follow these steps to set up your development environment.

Procedure

Note: We recommend using a modular package management system and code bundler. We are using Node Package Manager (NPM) and Webpack as examples here.

  1. Optionally, install a package manager and code bundler such as NPM and Webpack.

  2. If you have installed NPM and Webpack, verify the installation by running:

    $ npm -v
    
    $ webpack -v

    If NPM and Webpack are installed correctly, running these commands should return the version.

  3. Optionally, download the scaffold project. The scaffold project package contains a simple TypeScript-based NodeJS application to help you get started.

  4. Download the NavVis IVION Frontend API NPM package.

  5. Place a copy of the NPM package into your project folder:

    ├── navvis-ivion-VERSION.tgz <---
    ├── package.json
    ├── src
    │   ├── image
    │   │   └── favicon.ico
    │   ├── index.html
    │   ├── index.scss
    │   └── index.ts
    ├── tsconfig.json
    └── webpack.config.js
  6. If you are not using the scaffold project, add the NPM package to the project dependency by running:

      },
      "dependencies": {
        "@navvis/ivion": "file:navvis-ivion-VERSION.tgz"
      }
    }

    Note: Replace VERSION with the version number of the NPM package

  7. Install dependencies by running:

    $ npm install

Checking the Code

Procedure

  1. Open ./src/index.ts in your code editor. You should see:

    // index.ts
    import "./index.scss";
    import {getApi, ApiInterface} from "@navvis/ivion";
    
    class TestApp
    {
      public ivApi: ApiInterface;
    
      constructor()
      {
        getApi("https://iviondemo.iv.navvis.com/")
          .then((iv: ApiInterface) => {
            this.ivApi = iv;
            // Code added here will execute after NavVis IVION is completely loaded.
          })
      }
    }
    
    (<any>window).TestApp = new TestApp();

Initializing NavVis IVION

To initialize NavVis IVION, run:

getApi("https://iviondemo.iv.navvis.com/").then((iv: ApiInterface) => { /* run after IV loads. */ });

getApi(instanceUrl [, configuration]) instantiates NavVis IVION and returns a promise, which is used to run code after NavVis IVION is completely loaded.

The first argument of getApi() is the URL of your NavVis IVION instance.

The second, optional argument allows you to configure the behavior and appearance of NavVis IVION on startup. For example, if you want NavVis IVION to be in German, set the option to:

getApi("https://iviondemo.iv.navvis.com/", { "lang=de"}).then((iv: ApiInterface) => { /* run after IV loads. */ });

Embedding NavVis IVION

Procedure

  1. Open ./src/index.html in your code editor. You should see:

    <!DOCTYPE html>
    <html>
    <head>
      <title>IV API Testing App</title>
    </head>
    <body>
      <ivion></ivion>
    </body>
    </html>

The <ivion> tag is used by NavVis IVION to bootstrap and dynamically inject DOM elements and scripts into your application. This tag can be placed anywhere within your DOM structure.

Running the Application

Procedure

If you are using the scaffold project, run:

$ npm run serve

This will compile your code, start your default browser, and load the application.

Fetching Failed

If you receive an error similar to the following, your NavVis IVION instance is not reachable.

  1. Verify that:

    • The instance URL is correct.

    • You have network access to the instance.

CORS Disabled

If you receive the following error, you have to revise your CORS security settings.

  1. Go to Instance Settings > Instance Configuration.

  2. Revise your CORS security settings.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.