Documentation
Reference
2.1.56 (current version)
collection
interactivityModel
Interfaces

IRoutePanel

Extends IEventEmitter.

Interface for route panel.

Constructor | Fields | Events | Methods

Constructor

IRoutePanel()

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

optionsIOptionManager

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 } - 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.

stateIDataManager

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

NameDescription
disable

Route panel is unloaded.

enable

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

Methods

NameReturnsDescription
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

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 } - 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:

ParameterDefault valueDescription
name*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

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

* Mandatory parameter/option.

getRoute

Depricated: 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).