Skip to content

Indoor

Warning

This plugin has been deprecated in favor of related_previews plugin.

This plugin checks related plugin for an "indoor" entry. If it exists creates an interface element with the preview of that related view. If the related view is loaded, the preview will change to go back to the seat view.

  • Plugin name: "indoor"
  • Plugin namespace: "indoor"

Dependencies

This plugin has the following dependencies (they will be downloaded automatically):

Loading the plugin

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

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:

Callbacks

This plugin adds the following new callback triggers, additionally to the default ones:

  • click_indoor_preview: Will be called when the user clicks the indoor preview. The first parameter will be a default callback object with an additional property called indoor with the following content:
    • venue_id (string): venue id of the indoor view.
    • view_id (string): view id of the indoor view.
1
2
3
4
5
6
7
viewer3d.subscribe("click_indoor_preview", function(obj) {
    if (obj.indoor) {
        viewer3d.loadView3d(obj.indoor)
            .then(...)
            .catch(...);
    }
});

Methods

getIndoorRelatedView()

If the view has an indoor related view, it will return the same output as getRelatedViewByName, or null if it has not.

Flags

show_indoor_preview

enables or disables the indoor preview.

Example
viewer3d.indoor.flags.show_indoor_preview = false;

Example

Code

var input_options = {
    container: "viewer3d-container",
    plugins: ["indoor"]
};

DVM.loadModule("3d_viewer", input_options)
    .then(function(viewer3d) {
        start(viewer3d);

    })
    .catch(function(err) {
        console.error(err);
    });

function start(viewer3d) {
    viewer3d.subscribe("click_indoor_preview", function(obj) {
        load(obj.indoor);
    });

    load({ venue_id: "eu-es-00040-realmadrid", view_id: "S_201" });

    function load(load_options) {
    // Load the 3d view
    viewer3d.loadView3d(load_options)
        .then(function(obj) {
            // Successfully loaded
            console.log("LOADED!");
        })
        .catch(function(err) {
            // Error while loading
            console.error(err);
        });
    }
}