====== Getting started Javascript SDK ====== This page describes how to initialize the Javascript SDK in a web environment. ===== Loading the library ===== By downloading and using the Orbit 3DM Viewer SDK, you agree with the terms of use on the development and usage of Orbit GT's 3DM Viewer SDK: \\ [[https://orbitgt.com/legal/developer-terms-of-use/|]]. The library is compiled as a UMD (universal module definition) library and can as such be used in different javascript environments. \\ It can be referenced by using this URL : **https://cdn.3dmapping.cloud//javascript/orbitgt_3dm_sdk.js** Replace **** by the actual version you want to use. \\ For example to use SDK version 20.9.0 : https://cdn.3dmapping.cloud/20.9.0/javascript/orbitgt_3dm_sdk.js ===== Usage in a document context ===== Using the library on a browser document is straightforward. ==== Add Script Tag ==== Add the following script tag to your application. Example for SDK version 20.9.0 ==== Create Viewer instance ==== Before we can start using the library, you must wait for the browser document to be fully loaded. The code below is the most basic way of doing that by waiting for the ''DOMContentLoaded'' event. \\ Once the library is ready, we can instantiate the ''SDKViewer'' class. \\ The initial state of the viewer can be tweaked by providing [[214:viewer:sdk:concepts|startup options]] defined by the ''Constants'' class. You can use startup options to [[214:viewer:sdk:viewer_state|]] or set the communication [[214:viewer:sdk:concepts|CRS]]. \\ After creating the viewer, wait for the ''isReady'' promise to resolve.