---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.2
alternate:
  - https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md
  - https://yandex.ru/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/router.Editor.md
  - href: https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt?revision=r21950234
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt?revision=r21950234

# router.Editor

{% note info %}

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

{% endnote %}

Extends [ICustomizable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md), [IEventEmitter](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md).

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

[Fields](#properties-summary) | [Events](#events-summary) | [Methods](#methods-summary)

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events) | [IEventManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md) | Event manager.

Inherited from [IEventEmitter](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events). ||
|| [options](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#options) | [IOptionManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md) | Options manager.

Inherited from [ICustomizable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#options). ||
|| [state](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#state) | [IDataManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IDataManager.md) | 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 {#events-summary}

#|
|| **Name** | **Description** ||
|| [optionschange](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#event-optionschange) | Change to the object options.

Inherited from [ICustomizable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#event-optionschange). ||
|| [routeupdate](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-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](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-start) | Enabling the editor. ||
|| [stop](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-stop) | Disabling the editor. ||
|| [viapointadd](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-viapointadd) | Adding a throughpoint. Use e.get('viaPoint') to get a throughpoint to be added. ||
|| [viapointdragend](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-viapointdragend) | End of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint. ||
|| [viapointdragstart](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-viapointdragstart) | Start of throughpoint dragging. Use e.get('viaPoint') to get a throughpoint. ||
|| [viapointremove](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-viapointremove) | Deleting a throughpoint. Use e.get('viaPoint') to get a throughpoint to be deleted. ||
|| [waypointadd](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-waypointadd) | Adding a waypoint. Use e.get('wayPoint') to get a waypoint to be added. ||
|| [waypointdragend](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-waypointdragend) | End of waypoint dragging. Use e.get('wayPoint') to get a waypoint. ||
|| [waypointdragstart](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-waypointdragstart) | Start of waypoint dragging. Use e.get('wayPoint') to get a waypoint. ||
|| [waypointremove](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#event-waypointremove) | Deleting a waypoint. Use e.get('wayPoint') to get a waypoint to be deleted. ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [start](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#start)(\[[options](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#start-param-options)]) | Enables the route editor. ||
|| [stop](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/router.Editor.md#stop)() | Disables the route editor. ||
|#

## Fields details {#field_detail}

### state {#state}

```javascript
{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 {#event_detail}

### routeupdate {#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 {#start}

Enabling the editor.

### stop {#stop}

Disabling the editor.

### viapointadd {#viapointadd}

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

### viapointdragend {#viapointdragend}

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

### viapointdragstart {#viapointdragstart}

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

### viapointremove {#viapointremove}

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

### waypointadd {#waypointadd}

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

### waypointdragend {#waypointdragend}

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

### waypointdragstart {#waypointdragstart}

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

### waypointremove {#waypointremove}

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

## Methods details {#method_detail}

### start {#start}

```javascript
{} start([options])
```

Enables the route editor.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`options`](#start-param-options) | — | Type: Object

Options. ||
|| [`options.addViaPoints`](#start-param-options.addViaPoints) | true | Type: Boolean

If true, adding throughpoints is allowed; if false, it is prohibited. ||
|| [`options.addWayPoints`](#start-param-options.addWayPoints) | false | Type: Boolean

If true, waypoints can be added when clicking on the map; if false, this is prohibited. ||
|| [`options.editViaPoints`](#start-param-options.editViaPoints) | true | Type: Boolean

If true, editing (moving) throughpoints is allowed; if false, it is prohibited. ||
|| [`options.editWayPoints`](#start-param-options.editWayPoints) | true | Type: Boolean

If true, editing (moving) waypoints is allowed; if false, it is prohibited. ||
|| [`options.removeViaPoints`](#start-param-options.removeViaPoints) | true | Type: Boolean

If true, deleting throughpoints by double-click is allowed; if false, it is prohibited. ||
|| [`options.removeWayPoints`](#start-param-options.removeWayPoints) | false | Type: Boolean

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


### stop {#stop}

```javascript
{} stop()
```

Disables the route editor.