---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/multiRouter.Editor.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# multiRouter.Editor

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

Multi-route editor.

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

## Constructor {#constructor-summary}

```javascript
multiRouter.Editor(multiRoute[, state[, options]])
```

Creates a multi-route editor.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`multiRoute`](#param-multiRoute)[*](*star) | — | Type: [multiRouter.MultiRoute](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.MultiRoute.md)

The multi-route being edited. ||
|| [`state`](#param-state) | — | Type: Object

Object which describes the initial state of the editor. For a list of available fields, see [multiRouter.Editor.state](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#state). ||
|| [`options`](#param-options) | — | Type: Object

Options. ||
|| [`options.drawCursor`](#param-options.drawCursor) | — | Type: Object

Name of the cursor to use in waypoint drawing mode. ||
|| [`options.drawOver`](#param-options.drawOver) | true | Type: Object

Allows putting points on top of map objects in waypoint drawing mode. ||
|| [`options.midPointsType`](#param-options.midPointsType) | "way" | Type: String

Specifies the type of points to add while dragging the marker which appears when hovering the mouse cursor over the active route. Accepts one of the following string values: 
- "way" - Add waypoints.
- "via" - Add throughpoints.
See also the description of the addMidPoints field for the state manager [multiRouter.Editor.state](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#state). ||
|#

\* Mandatory parameter/option.

## Fields {#properties-summary}

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

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

Inherited from [ICustomizable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#options). ||
|| [state](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#state) | [data.Manager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/data.Manager.md) | The state manager of the multiroute editor.

Available fields:

- addWayPoints: Boolean - Allows adding new waypoints by clicking on the map. Default value: false.
- dragWayPoints: Boolean - Allows dragging existing waypoints. Default value: true.
- removeWayPoints: Boolean - Allows deleting waypoints by double-clicking on them. Default value: false.
- dragViaPoints: Boolean - Allows dragging existing throughpoints. Default value: true.
- removeViaPoints: Boolean - Allows deleting throughpoints by double-clicking on them. Default value: true.
- addMidPoints: Boolean - Allows adding intermediate throughpoints or waypoints by dragging 		the placemark which appears when you hover the mouse over the active route. The type of point to add is set by the option midPointsType. Default value: true. ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [beforemidpointadd](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforemidpointadd) | Event preceding the "midpointadd" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates for adding a midpoint.
- pointType: String - Type ID for the midpoint being added.
- insertIndex: Integer - The insertion index of the midpoint in the set of reference 	points for the multiroute.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPointType - The method that allows you to set the type of the added point. Takes a string identifier 	of the type as the argument (see the description of the midPointsType option).
- setInsertIndex - The method that allows you to adjust the insertion index of a midpoint 	before it is applied. Takes the new index as the argument.
If you call the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method of this event, the next midpoint to add, as well as the "midpointadd" event, will be canceled. ||
|| [beforemidpointdrag](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforemidpointdrag) | The event preceding the "midpointdrag" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPixelOffset - This method is for correcting the value of the pixel offset that will 	actually be applied. It takes an argument with the new pixel offset in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, the subsequent "midpointdrag" event will be canceled. ||
|| [beforemidpointpinshow](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforemidpointpinshow) | The event preceding the "midpointpinshow" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pin: [Placemark](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Placemark.md) - Reference to the placemark object.
- globalPixels: Number[] - Global pixel coordinates of the placemark.
- segment: [multiRouter.driving.Segment](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.Segment.md) - Reference to the segment of the route where 	the placemark should appear.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, a subsequent "midpointpinshow" event will be canceled and the placemark will be hidden. ||
|| [beforeviapointdrag](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforeviapointdrag) | The event preceding the "viapointdrag" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPixelOffset - This method is for correcting the value of the pixel offset that will 	actually be applied. It takes an argument with the new pixel offset in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, a subsequent "viapointdrag" event will be canceled. ||
|| [beforeviapointdragstart](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforeviapointdragstart) | The event preceding the "viapointdragstart" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, any subsequent dragging, as well as the "viapointdragstart" event, will be canceled. ||
|| [beforeviapointremove](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforeviapointremove) | The event preceding the "viapointremove" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being deleted.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, deletion of a throughpoint, as well as a subsequent "viapointremove" event, will be canceled. ||
|| [beforewaypointadd](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforewaypointadd) | Event preceding the "waypointadd" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates of the added waypoint.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setCoords - Method that allows you to adjust the coordinates of the waypoint being added. It takes an argument with the new pixel shift in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, addition of a waypoint, as well as a subsequent "waypointadd" event, will be canceled. ||
|| [beforewaypointdrag](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforewaypointdrag) | The event preceding the "waypointdrag" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPixelOffset - This method is for correcting the value of the pixel offset that will 	actually be applied. It takes an argument with the new pixel offset in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, a subsequent "waypointdrag" event will be canceled. ||
|| [beforewaypointdragstart](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforewaypointdragstart) | The event preceding the "waypointdragstart" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, any subsequent dragging, as well as the "waypointdragstart" event, will be canceled. ||
|| [beforewaypointremove](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-beforewaypointremove) | The event preceding the "waypointremove" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being deleted.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, removal of the waypoint, as well as a subsequent "waypointremove" event, will be canceled. ||
|| [midpointadd](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-midpointadd) | Adding a midpoint (intermediate point) to the route. The point type is determined by the value of the midPointsType option. Instance of the Event class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates for adding a midpoint.
- pointType: String - Type ID for the midpoint being added.
- insertIndex: Integer - The insertion index of the midpoint in the set of reference 	points for the multiroute. ||
|| [midpointdrag](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-midpointdrag) | Dragging the added midpoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step. ||
|| [midpointdragend](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-midpointdragend) | End of dragging the added midpoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|| [midpointpinshow](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-midpointpinshow) | Displaying the draggable placemark when you hover over the active route. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pin: [Placemark](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Placemark.md) - Reference to the placemark object.
- globalPixels: Number[] - Global pixel coordinates of the placemark.
- segment: [multiRouter.driving.Segment](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.Segment.md) - Reference to the segment of the route 	where the placemark appeared. ||
|| [optionschange](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#event-optionschange) | Change to the object options.

Inherited from [ICustomizable](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ICustomizable.md#event-optionschange). ||
|| [viapointdrag](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-viapointdrag) | Throughpoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged. ||
|| [viapointdragend](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-viapointdragend) | End of throughpoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged. ||
|| [viapointdragstart](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-viapointdragstart) | Start of throughpoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged. ||
|| [viapointremove](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-viapointremove) | Deleting a throughpoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the deleted throughpoint object. ||
|| [waypointadd](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-waypointadd) | Adding a waypoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates of the added waypoint. ||
|| [waypointdrag](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-waypointdrag) | Waypoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged. ||
|| [waypointdragend](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-waypointdragend) | End of waypoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged. ||
|| [waypointdragstart](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-waypointdragstart) | Start of waypoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged. ||
|| [waypointremove](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#event-waypointremove) | Deleting a waypoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the deleted waypoint object. ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [destroy](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#destroy)() | | Destroys the multi-route editor. ||
|| [getMultiRoute](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.Editor.md#getMultiRoute)() | [multiRouter.MultiRoute](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.MultiRoute.md) | Returns a reference to the multi-route being edited. ||
|#

## Fields details {#field_detail}

### state {#state}

```javascript
{data.Manager} state
```

The state manager of the multiroute editor.

Available fields:

- addWayPoints: Boolean - Allows adding new waypoints by clicking on the map. Default value: false.
- dragWayPoints: Boolean - Allows dragging existing waypoints. Default value: true.
- removeWayPoints: Boolean - Allows deleting waypoints by double-clicking on them. Default value: false.
- dragViaPoints: Boolean - Allows dragging existing throughpoints. Default value: true.
- removeViaPoints: Boolean - Allows deleting throughpoints by double-clicking on them. Default value: true.
- addMidPoints: Boolean - Allows adding intermediate throughpoints or waypoints by dragging 		the placemark which appears when you hover the mouse over the active route. The type of point to add is set by the option midPointsType. Default value: true.

## Events details {#event_detail}

### beforemidpointadd {#beforemidpointadd}

Event preceding the "midpointadd" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates for adding a midpoint.
- pointType: String - Type ID for the midpoint being added.
- insertIndex: Integer - The insertion index of the midpoint in the set of reference 	points for the multiroute.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPointType - The method that allows you to set the type of the added point. Takes a string identifier 	of the type as the argument (see the description of the midPointsType option).
- setInsertIndex - The method that allows you to adjust the insertion index of a midpoint 	before it is applied. Takes the new index as the argument.
If you call the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method of this event, the next midpoint to add, as well as the "midpointadd" event, will be canceled.

### beforemidpointdrag {#beforemidpointdrag}

The event preceding the "midpointdrag" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPixelOffset - This method is for correcting the value of the pixel offset that will 	actually be applied. It takes an argument with the new pixel offset in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, the subsequent "midpointdrag" event will be canceled.

### beforemidpointpinshow {#beforemidpointpinshow}

The event preceding the "midpointpinshow" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pin: [Placemark](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Placemark.md) - Reference to the placemark object.
- globalPixels: Number[] - Global pixel coordinates of the placemark.
- segment: [multiRouter.driving.Segment](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.Segment.md) - Reference to the segment of the route where 	the placemark should appear.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, a subsequent "midpointpinshow" event will be canceled and the placemark will be hidden.

### beforeviapointdrag  {#beforeviapointdrag}

The event preceding the "viapointdrag" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPixelOffset - This method is for correcting the value of the pixel offset that will 	actually be applied. It takes an argument with the new pixel offset in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, a subsequent "viapointdrag" event will be canceled.

### beforeviapointdragstart {#beforeviapointdragstart}

The event preceding the "viapointdragstart" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, any subsequent dragging, as well as the "viapointdragstart" event, will be canceled.

### beforeviapointremove {#beforeviapointremove}

The event preceding the "viapointremove" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being deleted.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, deletion of a throughpoint, as well as a subsequent "viapointremove" event, will be canceled.

### beforewaypointadd {#beforewaypointadd}

Event preceding the "waypointadd" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates of the added waypoint.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setCoords - Method that allows you to adjust the coordinates of the waypoint being added. It takes an argument with the new pixel shift in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, addition of a waypoint, as well as a subsequent "waypointadd" event, will be canceled.

### beforewaypointdrag {#beforewaypointdrag}

The event preceding the "waypointdrag" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.
Names of methods that are accessible via [Event.callMethod](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod): 
- setPixelOffset - This method is for correcting the value of the pixel offset that will 	actually be applied. It takes an argument with the new pixel offset in the form of an array of two numbers.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, a subsequent "waypointdrag" event will be canceled.

### beforewaypointdragstart {#beforewaypointdragstart}

The event preceding the "waypointdragstart" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, any subsequent dragging, as well as the "waypointdragstart" event, will be canceled.

### beforewaypointremove {#beforewaypointremove}

The event preceding the "waypointremove" event. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being deleted.
If the [Event.preventDefault](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault) method is called for this event, removal of the waypoint, as well as a subsequent "waypointremove" event, will be canceled.

### midpointadd {#midpointadd}

Adding a midpoint (intermediate point) to the route. The point type is determined by the value of the midPointsType option. Instance of the Event class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates for adding a midpoint.
- pointType: String - Type ID for the midpoint being added.
- insertIndex: Integer - The insertion index of the midpoint in the set of reference 	points for the multiroute.

### midpointdrag {#midpointdrag}

Dragging the added midpoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.

### midpointdragend  {#midpointdragend}

End of dragging the added midpoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

### midpointpinshow {#midpointpinshow}

Displaying the draggable placemark when you hover over the active route. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pin: [Placemark](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Placemark.md) - Reference to the placemark object.
- globalPixels: Number[] - Global pixel coordinates of the placemark.
- segment: [multiRouter.driving.Segment](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.Segment.md) - Reference to the segment of the route 	where the placemark appeared.

### viapointdrag {#viapointdrag}

Throughpoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.

### viapointdragend {#viapointdragend}

End of throughpoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.

### viapointdragstart {#viapointdragstart}

Start of throughpoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the throughpoint object being dragged.

### viapointremove {#viapointremove}

Deleting a throughpoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- viaPoint: [multiRouter.ViaPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPoint.md) - A reference to the deleted throughpoint object.

### waypointadd {#waypointadd}

Adding a waypoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- coords: Number[] - Coordinates of the added waypoint.

### waypointdrag {#waypointdrag}

Waypoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- pixelOffset: Number[] - Pixel shift along the axes at the given step.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.

### waypointdragend {#waypointdragend}

End of waypoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.

### waypointdragstart {#waypointdragstart}

Start of waypoint dragging. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- domEvent: [DomEvent](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/DomEvent.md) - The source DOM event, if there is one.
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the waypoint object being dragged.

### waypointremove {#waypointremove}

Deleting a waypoint. Instance of the [Event](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- wayPoint: [multiRouter.WayPoint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.WayPoint.md) - A reference to the deleted waypoint object.

## Methods details {#method_detail}

### destroy {#destroy}

```javascript
{} destroy()
```

Destroys the multi-route editor.

### getMultiRoute {#getMultiRoute}

```javascript
{multiRouter.MultiRoute} getMultiRoute()
```

**Returns** a reference to the multi-route being edited.

[*star]: Mandatory parameter/option.