Install a dizmo

To instantiate a dizmo, you must first install it. Use viewer.installBundle to do this. The installation is completed asynchronously. Thus, the rest of the environment does not have to wait for the procedure to finish.

To be notified of the installation, you may specify a callback function that is executed once the installation is complete. For example, this allows you to instantiate a dizmo from your bundle as soon as it becomes available.

// install a dizmo that is located inside of my own bundle in the assets directory
viewer.installBundle("bundle://assets/my_dizmo_v0.1.2.dzm", startDizmo);
// instantiate the dizmo from its bundle
function startDizmo(bundleid,error) {
        var newBundle = viewer.getBundleById(bundleid);
        var newDizmo = newBundle.instantiateDizmo();
}

To check if your bundle has been installed already, you may request a list of bundles installed (viewer.getBundles) and check if the dizmo is part of this list.