Skip to content

Related

Static Badge

This plugin manages the related maps or views that a particular map may have. A related map could be, for example, a neighbor section.

A map may have multiple related maps/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("map_viewer", input_options)
    .then(function(viewer) {
        start(viewer);
    })
    .catch(function(err) {
        console.error(err);
    });

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

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

Methods

getRelatedViews()

If the current map 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 = viewer.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) [optional]: Description label of the related view.
    • description (string) [optional]: Description of the related view.

This object can be used as input for loadView3d.

Example
var view = viewer.related.getRelatedViewByName("related0")

getRelatedMaps()

If the current map has related maps, it will return an object with the related maps. Otherwise, it will return null.

Output

An object with the identifier name of the related map as key and the result of getRelatedMapByName as value.

Example
var related = viewer.related.getRelatedMaps();

getRelatedMapByName()

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

Input
  • name_id (string): unique identifier name of the related map.
Output
  • related_map (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 map.
    • map_id (string): unique identifier of the related map to be loaded with loadMap.
    • label (string) [optional]: Description label of the related map.
    • description (string) [optional]: Description of the related map.

This object can be used as input for loadMap.

Example
var view = viewer.related.getRelatedMapByName("related")