Control a dizmo

Every dizmo can be controlled from another one. Do do this, you can get information about which dizmos have been created (i.e. are running) and in turn get additional information about each of them.

// get all the running dizmo instances
var runningDizmos = viewer.getDizmos();

// Get the rotation of the first dizmo in the list
var arot_dizmo_0 = runningDizmos[0].getAttribute('geometry/angle');

// get the Ids of all running dizmos
var to_dizmo_id = function to_bundle_id (dzm) {
        return dzm.identifier;
};
var runningDizmoIds = runningDizmos.map(to_dizmo_id);

You can also close a dizmo. Note however, that you can only close your own dizmo.

// close the dizmo
myDizmo.close();

For a complete list of the available viewer and bundle attributes and functions, please refer to the API documentation of the dizmojs.Viewer and dizmojs.Bundle class.

Once a dizmo is instantiated in dizmoViewer, you can move, set the position, size, zoom level and angle of other dizmos by changing their attributes with the following functions:

otherDizmo.setAttribute("geometry/angle",45);
otherDizmo.setAttribute("geometry/height",350);
otherDizmo.setAttribute("geometry/maxheight");
otherDizmo.setAttribute("geometry/minheight");
otherDizmo.setAttribute("geometry/width");
otherDizmo.setAttribute("geometry/maxwidth");
otherDizmo.setAttribute("geometry/minwidth");
otherDizmo.setAttribute("geometry/x");
otherDizmo.setAttribute("geometry/y");
otherDizmo.setAttribute("geometry/zoom");

For a more detailed description of these functions, take a look in the API documentation of the dizmojs.Dizmo class.