router.Route
Note
The constructor of the router.Route class is hidden, as this class is not intended for autonomous initialization.
Extends IGeoObject.
Object that describes the plotted route. The constructor is not available in the package.full (a standard set of modules). This module is loaded on demand.
See route
Fields
Name |
Type |
Description |
Route editor. |
||
Event manager. Inherited from IDomEventEmitter. |
||
IGeometry|null |
Geo object geometry. Inherited from IGeoObject. |
|
Options manager. Inherited from ICustomizable. |
||
Geo object data. Inherited from IGeoObject. |
||
State of the geo object. Inherited from IGeoObject. |
Events
Name |
Description |
Event for applying the route boundaries to the map with the options.mapStateAutoApply option set. |
|
Single left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Calls the element's context menu. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Double left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Change to the geo object geometry. Instance of the Event class. Names of fields that are available via the Event.get method:
Inherited from IGeoObject. |
|
Map reference changed. Data fields:
Inherited from IParentOnMap. |
|
Pressing the mouse button over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Pointing the cursor at the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Moving the cursor off of the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Moving the cursor over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Letting go of the mouse button over an object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface. Inherited from IDomEventEmitter. |
|
Repeating event during multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:
Inherited from IDomEventEmitter. |
|
Start of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:
Inherited from IDomEventEmitter. |
|
Change to the object options. Inherited from ICustomizable. |
|
Change to the geo object overlay. Instance of the Event class. Names of fields that are available via the Event.get method:
Inherited from IGeoObject. |
|
The parent object reference changed. Data fields:
Inherited from IChild. |
|
Change to the geo object data. Instance of the Event class. Names of fields that are available via the Event.get method:
Inherited from IGeoObject. |
|
Route updating event when the route editor is enabled. |
|
Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
Methods
Name |
Returns |
Description |
String |
Returns a string representation of route driving time with measurement units, with consideration for traffic. |
|
String |
Returns a string representation of route length with measurement units. |
|
String |
Returns a string representation of route driving time with measurement units. |
|
Integer |
Returns the route driving time in seconds, with consideration for traffic. |
|
Number |
Returns the length of the route in meters. |
|
getMap() |
Returns reference to the map. Inherited from IParentOnMap. |
|
Returns the promise object, which is confirmed by the overlay object at the time it is actually created, or is rejected with an appropriate error message. Inherited from IGeoObject. |
||
IOverlay|null |
The method provides synchronous access to the overlay. Inherited from IGeoObject. |
|
IParentOnMap|null |
Returns link to the parent object, or null if the parent element was not set. Inherited from IChildOnMap. |
|
getPaths() |
Returns a collection of paths that make up the route. |
|
getTime() |
Integer |
Returns the route driving time in seconds. |
Returns a collection of throughpoints on the route. |
||
Returns a collection of waypoints on the route. |
||
Sets the parent object. If the null value is passed, the manager element will only be deleted from the current parent object. Inherited from IChildOnMap. |
Fields details
editor
{router.Editor} editor
Route editor.
Example:
// Start of route editing.
ymaps.route(['Moscow', 'Petersburg'], function (route) {
route.editor.start();
// ...
// End of route editing.
route.editor.stop();
});
Events details
boundsapply
Event for applying the route boundaries to the map with the options.mapStateAutoApply option set.
update
Route updating event when the route editor is enabled.
Methods details
getHumanJamsTime
{String} getHumanJamsTime()
Returns a string representation of route driving time with measurement units, with consideration for traffic.
getHumanLength
{String} getHumanLength()
Returns a string representation of route length with measurement units.
getHumanTime
{String} getHumanTime()
Returns a string representation of route driving time with measurement units.
getJamsTime
{Integer} getJamsTime()
Returns the route driving time in seconds, with consideration for traffic.
getLength
{Number} getLength()
Returns the length of the route in meters.
getPaths
{GeoObjectCollection} getPaths()
Returns a collection of paths that make up the route.
getTime
{Integer} getTime()
Returns the route driving time in seconds.
getViaPoints
{GeoObjectCollection} getViaPoints()
Returns a collection of throughpoints on the route.
getWayPoints
{GeoObjectCollection} getWayPoints()
Returns a collection of waypoints on the route.