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
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from ICustomizable. |
||
The state manager of the route editor. Data fields that are available via the "get" and "set" methods:
|
Events
Name |
Description |
Change to the object options. Inherited from ICustomizable. |
|
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. |
|
Enabling the editor. |
|
Disabling the editor. |
|
Adding a throughpoint. Use e.get('viaPoint') to get a throughpoint to be added. |
|
End of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint. |
|
Start of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint. |
|
Deleting a throughpoint. Use e.get('viaPoint') to get a throughpoint to be deleted. |
|
Adding a waypoint. Use e.get('wayPoint') to get a waypoint to be added. |
|
End of waypoint dragging. Use e.get('wayPoint') to get a waypoint. |
|
Start of waypoint dragging. Use e.get('wayPoint') to get a waypoint. |
|
Deleting a waypoint. Use e.get('wayPoint') to get a waypoint to be deleted. |
Methods
Name |
Returns |
Description |
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 |
— |
Type: Object Options. |
|
true |
Type: Boolean If true, adding throughpoints is allowed; if false, it is prohibited. |
|
false |
Type: Boolean If true, waypoints can be added when clicking on the map; if false, this is prohibited. |
|
true |
Type: Boolean If true, editing (moving) throughpoints is allowed; if false, it is prohibited. |
|
true |
Type: Boolean If true, editing (moving) waypoints is allowed; if false, it is prohibited. |
|
true |
Type: Boolean If true, deleting throughpoints by double-click is allowed; if false, it is prohibited. |
|
false |
Type: Boolean If true, deleting waypoints by double-click is allowed; if false, it is prohibited. |
stop
{} stop()
Disables the route editor.