Skip to content

Related

This plugin manages the related views that a particular view may have. A related view could be, for example, a seat view related to a vip room.

A view may have multiple related views or none. They have an unique identifier name.

  • Plugin name: "related"
  • Plugin namespace: "related"

Dependencies

This plugin has no dependencies.

Loading the plugin

var input_options = {
    container: "container-id",
    plugins: ["related"]
};

DVM.loadModule("3d_viewer", input_options)
    .then(function(viewer3d) {
        start(viewer3d);
    })
    .catch(function(err) {
        console.error(err);
    });

function start(viewer3d) {
    // ...
}

If this plugin is loaded, the module will have the following additional features:

Methods

getRelatedViews()

If the current view has related views, it will return an object with the related views. Otherwise it will return null.

Output

An object with the identifier name of the related view as key and the result of getRelatedViewByName as value.

Example
var related = viewer3d.related.getRelatedViews();

getRelatedViewByName()

Returns the related view by its identifier name. If it does not exist, it will return null.

Input
  • name_id (string): unique identifier name of the related view.
Output
  • related_view (null|object): It will return null if it does not exist. If it exists, it will return an object with the following properties:
    • venue_id (string): venue id of the related view.
    • view_id (string): unique identifier of the related view to be loaded with loadView3d.
    • label (string|null): Description label of the related view.

This object can be used as input for loadView3d.

Example
var view = viewer3d.related.getRelatedViewByName("related")