IRoutePanel

Extends IEventEmitter.

Interface for route panel.

Constructor | Fields | Events | Methods

Constructor

IRoutePanel()

Fields

Name Type Description
events IEventManager

Event manager.

Inherited from IEventEmitter.

options IOptionManager
Option manager. Names of options:
  • allowSwitch: Boolean = true - Whether button for switching way points should be shown.
  • reverseGeocoding: Boolean = true - Whether reverse geocoding should be enabled during routing.
  • adjustMapMargin: Boolean = false - Whether the panel registers its size in the map margins manager map.margin.Manager.
  • types: Object = { auto: true, masstransit: true, pedestrian: true, taxi: false } - Specifies routing modes available for user to select in routing panel. When set, state.type is automatically adjusted, if current state.type becomes unavailable. Types are shown in panel only if two or more are available for user to select.
state IDataManager
State manager. Names of states:
  • type: String - Routing type IMultiRouteParams.routingMode.
  • fromEnabled: Boolean - Enables the "from" field for users to enter the route origin.
  • from: String - Address or coordinates of departure.
  • toEnabled: Boolean - Enables the "to" field for users to enter the route destination.
  • to: String - Address or coordinates of arrival.

Events

Name Description
disable

Route panel is unloaded.

enable

Route panel and it's dependencies are loaded and ready for user interactions.

Methods

Name Returns Description
enable()

Loads panel dependencies and enables it for usage.

geolocate(name)

vow.Promise

Use user's geolocation as coordinates for 'from' or 'to'.

getRoute()

multiRouter.MultiRoute

Attention. This method is deprecated. See IRoutePanel.getRouteAsync.

Returns built route.

getRouteAsync()

vow.Promise.<multiRouter.MultiRoute>

Returns vow.Promise, which will be resolved with built route. If an error occurs, the promise object is rejected.

isEnable()

Boolean

Returns whether panel is fully loaded.

switchPoints()

Switches points (and corresponding inputs).

Fields details

options

{IOptionManager} options
Option manager. Names of options:
  • allowSwitch: Boolean = true - Whether button for switching way points should be shown.
  • reverseGeocoding: Boolean = true - Whether reverse geocoding should be enabled during routing.
  • adjustMapMargin: Boolean = false - Whether the panel registers its size in the map margins manager map.margin.Manager.
  • types: Object = { auto: true, masstransit: true, pedestrian: true, taxi: false } - Specifies routing modes available for user to select in routing panel. When set, state.type is automatically adjusted, if current state.type becomes unavailable. Types are shown in panel only if two or more are available for user to select.

state

{IDataManager} state
State manager. Names of states:
  • type: String - Routing type IMultiRouteParams.routingMode.
  • fromEnabled: Boolean - Enables the "from" field for users to enter the route origin.
  • from: String - Address or coordinates of departure.
  • toEnabled: Boolean - Enables the "to" field for users to enter the route destination.
  • to: String - Address or coordinates of arrival.

Events details

disable

Route panel is unloaded.

enable

Route panel and it's dependencies are loaded and ready for user interactions.

Methods details

enable

{} enable()

Loads panel dependencies and enables it for usage.

geolocate

{vow.Promise} geolocate(name)

Use user's geolocation as coordinates for 'from' or 'to'.

Returns Promise object. See geolocation.

Parameters:

Parameter Default value Description
name *

Type: String

Input to geolocate. Either 'from' or 'to'.

* Mandatory parameter/option.

getRoute

This method is deprecated. See IRoutePanel.getRouteAsync.

Returns built route.

getRouteAsync

Returns vow.Promise which:

isEnable

{Boolean} isEnable()

Returns whether panel is fully loaded.

switchPoints

{} switchPoints()

Switches points (and corresponding inputs).