router.Editor

Note

The constructor of the router.Editor class is hidden, as this class is not intended for autonomous initialization.

Extends ICustomizable, IEventEmitter.

Route editor. The constructor is not available in the package.full (a standard set of modules). This module is loaded on demand.

Fields | Events | Methods

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

options

IOptionManager

Options manager.

Inherited from ICustomizable.

state

IDataManager

The state manager of the route editor.

Data fields that are available via the "get" and "set" methods:

  • routeloading: Boolean - Flag for whether the data is currently being downloaded from the routing service.
  • waypointsdrag: Boolean - Flag for whether the waypoint is currently being dragged.
  • viapointsdrag: Boolean - Flag for whether the throughpoint is currently being dragged.

Events

Name

Description

optionschange

Change to the object options.

Inherited from ICustomizable.

routeupdate

Updating the route. Using the value of the e.get('rough') flag, you can determine whether the event was thrown after editing was completed or during it. If you want your application to update information associated with the route, you need to make a check for e.get('rough') == false in order to avoid handling this event too often.

start

Enabling the editor.

stop

Disabling the editor.

viapointadd

Adding a throughpoint. Use e.get('viaPoint') to get a throughpoint to be added.

viapointdragend

End of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint.

viapointdragstart

Start of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint.

viapointremove

Deleting a throughpoint. Use e.get('viaPoint') to get a throughpoint to be deleted.

waypointadd

Adding a waypoint. Use e.get('wayPoint') to get a waypoint to be added.

waypointdragend

End of waypoint dragging. Use e.get('wayPoint') to get a waypoint.

waypointdragstart

Start of waypoint dragging. Use e.get('wayPoint') to get a waypoint.

waypointremove

Deleting a waypoint. Use e.get('wayPoint') to get a waypoint to be deleted.

Methods

Name

Returns

Description

start([options])

Enables the route editor.

stop()

Disables the route editor.

Fields details

state

{IDataManager} state

The state manager of the route editor.

Data fields that are available via the "get" and "set" methods:

  • routeloading: Boolean - Flag for whether the data is currently being downloaded from the routing service.
  • waypointsdrag: Boolean - Flag for whether the waypoint is currently being dragged.
  • viapointsdrag: Boolean - Flag for whether the throughpoint is currently being dragged.

Events details

routeupdate

Updating the route. Using the value of the e.get('rough') flag, you can determine whether the event was thrown after editing was completed or during it. If you want your application to update information associated with the route, you need to make a check for e.get('rough') == false in order to avoid handling this event too often.

start

Enabling the editor.

stop

Disabling the editor.

viapointadd

Adding a throughpoint. Use e.get('viaPoint') to get a throughpoint to be added.

viapointdragend

End of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint.

viapointdragstart

Start of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint.

viapointremove

Deleting a throughpoint. Use e.get('viaPoint') to get a throughpoint to be deleted.

waypointadd

Adding a waypoint. Use e.get('wayPoint') to get a waypoint to be added.

waypointdragend

End of waypoint dragging. Use e.get('wayPoint') to get a waypoint.

waypointdragstart

Start of waypoint dragging. Use e.get('wayPoint') to get a waypoint.

waypointremove

Deleting a waypoint. Use e.get('wayPoint') to get a waypoint to be deleted.

Methods details

start

{} start([options])

Enables the route editor.

Parameters:

Parameter

Default value

Description

options

Type: Object

Options.

options.addViaPoints

true

Type: Boolean

If true, adding throughpoints is allowed; if false, it is prohibited.

options.addWayPoints

false

Type: Boolean

If true, waypoints can be added when clicking on the map; if false, this is prohibited.

options.editViaPoints

true

Type: Boolean

If true, editing (moving) throughpoints is allowed; if false, it is prohibited.

options.editWayPoints

true

Type: Boolean

If true, editing (moving) waypoints is allowed; if false, it is prohibited.

options.removeViaPoints

true

Type: Boolean

If true, deleting throughpoints by double-click is allowed; if false, it is prohibited.

options.removeWayPoints

false

Type: Boolean

If true, deleting waypoints by double-click is allowed; if false, it is prohibited.

stop

{} stop()

Disables the route editor.