Constructor

Navigator ()

Navigator, responsible for displaying directions in simple and complex journeys

Show:
_drawVirtualLayer () Object private

Draws virtual Layers (private)

Returns:

Object:

Marker

_removeVirtualLayers () private

Zooms back out into overview mode, displaying the whole journey, draws the full path once again.

hideOverview () Promise

Exits out of navigation and focuses on currently selected map.

Returns:

Promise:

A promise that will resolve once the currently selected map is focused on

reset ()

Reset overview state

setDirections
(
  • directions
)

Sets up the navigator for a set of directions. Typically uses directions returned by startNode.directionsTo() calls.

This can be used to update the directions object any time.

Parameters:

  • directions Object

    Directions object returned by startNode.directionsTo()

    • path Array

      Array of nodes representing path to travel

    • instructions Array

      Array of instructions for journey

setOptions
(
  • options
)

Sets up navigator settings. Typically uses options as documented by Navigator.showOverview() *

Parameters:

  • [options] Object optional

    Options Object

    • [hideLabels=false] Boolean optional

      Hide labels after showing journey

    • [drawConnectionMarkers=true] Boolean optional

      Draw multi-floor connection markers

    • [drawDepartureMarker=true] Boolean optional

      Draw marker indicating departure

    • [drawDestinationMarker=true] Boolean optional

      Draw marker indicating destination

    • [showConnectionType=true] Boolean optional

      Adds icon indicating connection type to connection markers

    • [debug=false] Boolean optional

      Show debug information

    • [connectionsThreshold=100] Number optional

      Distance in meters between entry and exit connections on a floor to use as a threshold to make it into a virtual layer

    • [combineSimilarConnections=true] Boolean optional

      Combine floors with similar entry and exit connections into virtual layers

    • [pathOptions] Object optional

      Options for path drawing. See MapView3D/drawPath options for customizing path

    • [focusOptions] Object optional

      Options for focusing on the path when in single floor mode. See See MapView3D/focusOn

    • [showPathBehindObjects=false] Boolean optional

      Show occluded path portions with lowered transparency

    • [expandOptions] Object optional

      Options for expanding the maps.

      • [enabled] Boolean optional
        Determine whether to expand the maps or remain in single map mode
      • [focus=false] Boolean optional
        Focus the camera onto expanded maps
      • [rotation=0] Number optional
        Rotation of scene relative to zero (degrees)
      • [duration=300] Number optional
        Duration of focus animation in ms
      • [focusOnInteractivePolygons=false] Boolean optional
        Determine whether to focus on full map objects or only interactive polygons
setScale
(
  • scale
)

Sets multiplier scale to better fit 4K and 8K screens at 1:1 pixel ratio. If stuff is too small on 4K screens, set to 2, etc.

Parameters:

  • scale Number=1

    Scale up DOM elements by this multiplier

showOverview
(
  • directions
  • [directions.animationDuration}
)
Promise

Enters journey overview mode. Handles multi-floor navigation and drawing of the path.

Note: Pass directions if they haven't been set using Navigator.setDirections()

Parameters:

  • [directions] Object optional

    Optional parameters to customize specific behaviours.

    • [path] Array optional

      Array of nodes representing path to travel

    • [instructions] Array optional

      Array of instructions for journey

    • [options] Object optional

      Options object as documented in setOptions

  • [directions.animationDuration} Number

    Time in ms for the animation to take

Returns:

Promise:

A promise that will resolve once the maps are displayed and path drawn

zoomIn
(
  • mapId
)
Promise

Zooms into a specific map in the journey. This can be useful when showing the user detailed directions on a specific map *

Parameters:

Returns:

Promise:

A promise that will resolve once the map is zoomed in to

zoomOut () Promise

Zooms back out into overview mode, displaying the whole journey, draws the full path once again. *

Returns:

Promise:

A promise that will resolve once the map is zoomed in to

mode

String

The mode that navigator is currently in. One of SINGLEFLOOR, MULTIFLOOR_OVERVIEW, MULTIFLOOR_FOCUSED

MODES

Number[]

projections

readonly

Display 2D screen projections of each 3D map object in the journey. Useful for drawing 2D elements on screen.

Example:

projections = [{
      max: {
          x: 1062.4393974378236,
          y: 745.7583492891705
      },
      min: {
          x: 17.560602562176346,
          y: 225.0806956450056
      }
  ...
  ]

onConnectionClicked

Fired when clicking on a map connection marker when in multi-floor mode. Return true in passed in function to prevent default behavior

Event Payload: