Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces

multiRouter.EditorAddon

Note. The constructor of the multiRouter.EditorAddon class is hidden, as this class is not intended for autonomous initialization.

Extends ICustomizable, IEventEmitter.

Add-on for the multi-stop route editor.

Fields | Events | Methods

Creates an add-on for the multi-stop route editor.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

optionsIOptionManager

Options manager.

Inherited from ICustomizable.

statedata.Manager

The state manager of the multi-stop route editor.

Events

NameDescription
beforemidpointadd

Event preceding the "midpointadd" event. Instance of the Event class. Names of fields that are available via the Event.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 multi-stop route.
Names of methods that are accessible via Event.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 method of this event, the next midpoint to add, as well as the "midpointadd" event, will be canceled.

beforemidpointdrag

The event preceding the "midpointdrag" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
Names of methods that are accessible via Event.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 method is called for this event, the subsequent "midpointdrag" event will be canceled.

beforemidpointpinshow

The event preceding the "midpointpinshow" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pin: Placemark - Reference to the placemark object.
  • globalPixels: Number[] - Global pixel coordinates of the placemark.
  • segment: multiRouter.driving.Segment - Reference to the segment of the route where the placemark should appear.
If the Event.preventDefault method is called for this event, a subsequent "midpointpinshow" event will be canceled and the placemark will be hidden.

beforeviapointdrag

The event preceding the "viapointdrag" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.
Names of methods that are accessible via Event.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 method is called for this event, a subsequent "viapointdrag" event will be canceled.

beforeviapointdragstart

The event preceding the "viapointdragstart" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.
If the Event.preventDefault method is called for this event, any subsequent dragging, as well as the "viapointdragstart" event, will be canceled.

beforeviapointremove

The event preceding the "viapointremove" event. Instance of the Event class. Names of fields that are available via the Event.get method:

If the Event.preventDefault method is called for this event, deletion of a throughpoint, as well as a subsequent "viapointremove" event, will be canceled.

beforewaypointadd

Event preceding the "waypointadd" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • coords: Number[] - Coordinates of the added waypoint.
Names of methods that are accessible via Event.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 method is called for this event, addition of a waypoint, as well as a subsequent "waypointadd" event, will be canceled.

beforewaypointdrag

The event preceding the "waypointdrag" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.
Names of methods that are accessible via Event.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 method is called for this event, a subsequent "waypointdrag" event will be canceled.

beforewaypointdragstart

The event preceding the "waypointdragstart" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.
If the Event.preventDefault method is called for this event, any subsequent dragging, as well as the "waypointdragstart" event, will be canceled.

beforewaypointremove

The event preceding the "waypointremove" event. Instance of the Event class. Names of fields that are available via the Event.get method:

If the Event.preventDefault method is called for this event, removal of the waypoint, as well as a subsequent "waypointremove" event, will be canceled.

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 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 multi-stop route.

midpointdrag

Dragging the added midpoint. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.

midpointdragend

End of dragging the added midpoint. Instance of the Event class.

midpointpinshow

Displaying the draggable placemark when you hover over the active route. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pin: Placemark - Reference to the placemark object.
  • globalPixels: Number[] - Global pixel coordinates of the placemark.
  • segment: multiRouter.driving.Segment - Reference to the segment of the route where the placemark appeared.

optionschange

Change to the object options.

Inherited from ICustomizable.

start

Enabling the editor. Instance of the Event class.

stop

Disabling the editor. Instance of the Event class.

viapointdrag

Throughpoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.

viapointdragend

End of throughpoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

viapointdragstart

Start of throughpoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.

viapointremove

Deleting a throughpoint. Instance of the Event class. Names of fields that are available via the Event.get method:

waypointadd

Adding a waypoint. Instance of the Event class. Names of fields that are available via the Event.get method:

  • coords: Number[] - Coordinates of the added waypoint.

waypointdrag

Waypoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.

waypointdragend

End of waypoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

waypointdragstart

Start of waypoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.

waypointremove

Deleting a waypoint. Instance of the Event class. Names of fields that are available via the Event.get method:

Methods

NameReturnsDescription
isActive()

Boolean

Returns a flag for whether the editor is currently enabled.

start(state)

Enables the editor.

stop()

Disables the editor.

Fields details

state

{data.Manager} state

The state manager of the multi-stop route editor.

Events details

beforemidpointadd

Event preceding the "midpointadd" event. Instance of the Event class. Names of fields that are available via the Event.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 multi-stop route.
Names of methods that are accessible via Event.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 method of this event, the next midpoint to add, as well as the "midpointadd" event, will be canceled.

beforemidpointdrag

The event preceding the "midpointdrag" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
Names of methods that are accessible via Event.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 method is called for this event, the subsequent "midpointdrag" event will be canceled.

beforemidpointpinshow

The event preceding the "midpointpinshow" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pin: Placemark - Reference to the placemark object.
  • globalPixels: Number[] - Global pixel coordinates of the placemark.
  • segment: multiRouter.driving.Segment - Reference to the segment of the route where the placemark should appear.
If the Event.preventDefault method is called for this event, a subsequent "midpointpinshow" event will be canceled and the placemark will be hidden.

beforeviapointdrag

The event preceding the "viapointdrag" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.
Names of methods that are accessible via Event.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 method is called for this event, a subsequent "viapointdrag" event will be canceled.

beforeviapointdragstart

The event preceding the "viapointdragstart" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.
If the Event.preventDefault method is called for this event, any subsequent dragging, as well as the "viapointdragstart" event, will be canceled.

beforeviapointremove

The event preceding the "viapointremove" event. Instance of the Event class. Names of fields that are available via the Event.get method:

If the Event.preventDefault method is called for this event, deletion of a throughpoint, as well as a subsequent "viapointremove" event, will be canceled.

beforewaypointadd

Event preceding the "waypointadd" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • coords: Number[] - Coordinates of the added waypoint.
Names of methods that are accessible via Event.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 method is called for this event, addition of a waypoint, as well as a subsequent "waypointadd" event, will be canceled.

beforewaypointdrag

The event preceding the "waypointdrag" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.
Names of methods that are accessible via Event.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 method is called for this event, a subsequent "waypointdrag" event will be canceled.

beforewaypointdragstart

The event preceding the "waypointdragstart" event. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.
If the Event.preventDefault method is called for this event, any subsequent dragging, as well as the "waypointdragstart" event, will be canceled.

beforewaypointremove

The event preceding the "waypointremove" event. Instance of the Event class. Names of fields that are available via the Event.get method:

If the Event.preventDefault method is called for this event, removal of the waypoint, as well as a subsequent "waypointremove" event, will be canceled.

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 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 multi-stop route.

midpointdrag

Dragging the added midpoint. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.

midpointdragend

End of dragging the added midpoint. Instance of the Event class.

midpointpinshow

Displaying the draggable placemark when you hover over the active route. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pin: Placemark - Reference to the placemark object.
  • globalPixels: Number[] - Global pixel coordinates of the placemark.
  • segment: multiRouter.driving.Segment - Reference to the segment of the route where the placemark appeared.

start

Enabling the editor. Instance of the Event class.

stop

Disabling the editor. Instance of the Event class.

viapointdrag

Throughpoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.

viapointdragend

End of throughpoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

viapointdragstart

Start of throughpoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • viaPoint: multiRouter.ViaPoint - A reference to the throughpoint object being dragged.

viapointremove

Deleting a throughpoint. Instance of the Event class. Names of fields that are available via the Event.get method:

waypointadd

Adding a waypoint. Instance of the Event class. Names of fields that are available via the Event.get method:

  • coords: Number[] - Coordinates of the added waypoint.

waypointdrag

Waypoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • pixelOffset: Number[] - Pixel shift along the axes at the given step.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.

waypointdragend

End of waypoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

waypointdragstart

Start of waypoint dragging. Instance of the Event class. Names of fields that are available via the Event.get method:

  • domEvent: DomEvent - The source DOM event, if there is one.
  • wayPoint: multiRouter.WayPoint - A reference to the waypoint object being dragged.

waypointremove

Deleting a waypoint. Instance of the Event class. Names of fields that are available via the Event.get method:

Methods details

isActive

{Boolean} isActive()

Returns a flag for whether the editor is currently enabled.

start

{} start(state)

Enables the editor.

Parameters:

ParameterDefault valueDescription
state*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

The initial state of the editor.

* Mandatory parameter/option.

stop

{} stop()

Disables the editor.