A handle to a 3D marker added to a map.

Show:
addThreeJSMarker
(
  • options
)
ThreeJSMarkerHandle

Add a ThreeJS marker to this map object. This should be called through the MapView3D.

Parameters:

  • options Object
    • [object] Object3D optional

      the marker object to add to the scene

    • [position=null] Vector3 optional

      if provided, sets the object's position on the map

    • [rotation=null] Euler optional

      if provided, sets the object's rotation relative to the map

    • [scale=null] Vector3 optional

      if provided, sets the object's scale relative to the map

Returns:

ThreeJSMarkerHandle:

a unique identifier for the marker

contractMaps
(
  • options
)

Contract maps and display the current map

Parameters:

  • options Object

    Options object @optional

    • [focus] Boolean optional

      Focus the camera onto current map

    • [debug] Boolean optional

      Display cubes around focus bounding box for debug info

    • [duration=300] Number optional

      Duration of focus animation in ms

expandMaps
(
  • mapIds
  • options
)
Promise

Expand maps to display within view, typically used for multi-floor navigation. When passed a connection, maps included will not be displayed, instead, their 2d projection will be available in the resulting promise, which can be used to display a 2D component in the client-side app.

Parameters:

  • mapIds Array

    Array of mapIds or mapObjects to display while expanded. For connections, pass { connection: true, maps: [], connectionNodes: [], }

  • options Object

    Options object @optional

    • [focus=false] Boolean optional

      Focus the camera onto expanded maps

    • [debug=false] Boolean optional

      Display cubes around focus bounding box for debug info

    • [rotation=0] Number optional

      Rotation of scene relative to zero (degrees)

    • [duration=300] Number optional

      Duration of focus animation in ms

Returns:

Promise:

Promise that resolves to 2d screen projections of each layer/map (see example)

Example:

// expand maps with 3 connection maps in between
  expandMaps(
      '55e89771d982bc06ca000000',
          {
              connection: true,
              // connection nodes are an exit node from the '55e89771' man and entry node for the '55e9c73f' map
              connectionNodes: [{
                  map: "55e89771",
                  x: 6232,
                  y: 4575
              }, {
                  map: "55e9c73",
                  x: 5945.000000000001,
                  y: 4059.000000000001
              }],
              maps: [
                  '55e9acbf',
                  '55e8a9ed',
                  '55e85e23'
              ]
          },
          '55e9c73f'
       );
  
       // resulting promise (sorted by elevation (top to bottom))
  
       [
          {
              min: { x: -100, y: -50 },
              max: { x: -100, y: -50 }
          },
          {
              min: { x: -100, y: -50 },
              max: { x: -100, y: -50 }
          },
          {
              min: { x: -100, y: -50 },
              max: { x: -100, y: -50 }
          }
       ]
removeThreeJSMarker
(
  • markerHandle
)
Boolean

Remove the given ThreeJSMarker from this map.

Parameters:

Returns:

Boolean:

true if the marker existed on the map and was removed; false if the marker does not exist on the map

removeThreeJSMarker ()

Remove all ThreeJSMarker from this map.

object

Object3D

Return the ThreeJS object associated with this marker, so that it can be moved around, scaled, etc.