multiRouter.driving.PathModel
Extends IEventEmitter.
Data model for the path of a driving route. A single route can contain several paths, and each path connects two waypoints.
Creates the data model of a driving route path.
Fields
Name | Type | Description |
---|---|---|
events | IEventManager | Event manager. Inherited from IEventEmitter. |
properties | data.Manager | Multiroute's path data.
The following fields are available:
|
route | multiRouter.driving.RouteModel | Reference to the parent model of the route. |
Name | Type | Description |
---|---|---|
events | IEventManager | Event manager. Inherited from IEventEmitter. |
properties | data.Manager | Multiroute's path data.
The following fields are available:
|
route | multiRouter.driving.RouteModel | Reference to the parent model of the route. |
Events
Name | Description |
---|---|
update |
Methods
Name | Returns | Description |
---|---|---|
destroy() | Destroys a model. | |
getSegments() | Returns array of path segments. | |
getType() | String | Returns ID of the route path type. For automobile routes, it returns the string "driving". |
update(pathJson) | Updates the state of the model. |
Name | Returns | Description |
---|---|---|
destroy() | Destroys a model. | |
getSegments() | Returns array of path segments. | |
getType() | String | Returns ID of the route path type. For automobile routes, it returns the string "driving". |
update(pathJson) | Updates the state of the model. |
Fields details
properties
{data.Manager} properties
- index: Integer - The sequential number of the path in the multiroute's corresponding route.
- type: String - Route type identifier, which takes the value "driving" for automobile routes.
- distance: Object - An object with the "text" and "value" fields that describes the length of the path in meters.
- duration: Object - An object with the "text" and "value" fields that describes the travel time of the path in seconds.
- durationInTraffic: Object - An object with the "text" and "value" fields that specifies the travel time of the path (in seconds) considering traffic.
- coordinates: Number[][] - Coordinates of all points on the path.
- encodedCoordinates: String - A string of base64-encoded coordinates for all points on the path.
route
{multiRouter.driving.RouteModel} route
Reference to the parent model of the route.
Events details
Methods details
destroy
{} destroy()
Destroys a model.
getSegments
{multiRouter.driving.SegmentModel[]} getSegments()
Returns array of path segments.
getType
{String} getType()
Returns ID of the route path type. For automobile routes, it returns the string "driving".
update
{} update(pathJson)
Updates the state of the model.
Parameters:
* Mandatory parameter/option.