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

# multiRouter.masstransit.PathModel

{% note info %}

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

{% endnote %}

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

Data model of a path on a public transport route. A single route can contain several paths, and each path connects two waypoints.

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

Creates a data model for a path on a public transport route.

## 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). ||
|| [properties](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#properties) | [data.Manager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/data.Manager.md) | Multiroute's path data. The following fields are available: 
- index: Integer - The sequential number of the path in the 	multiroute's corresponding route.
- type: String - Route type identifier, which takes the value "masstransit" 	for public transport 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.
- coordinates: Number[][] - Coordinates of all points on the path.
- encodedCoordinates: String - A string of base64-encoded coordinates for all points 	on the path. ||
|| [route](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#route) | [multiRouter.masstransit.RouteModel](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.RouteModel.md) | Reference to the parent model of the route. ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [update](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#event-update) | Updating the model with new data. 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: 
- segmentsChange: Boolean - Flag for whether the set of segments is changed ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [destroy](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#destroy)() | | Destroys a model. ||
|| [getSegments](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#getSegments)() | ([multiRouter.masstransit.TransferSegmentModel](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.TransferSegmentModel.md)\| multiRouter.masstransit.TransportSegmentModel\| [multiRouter.masstransit.WalkSegmentModel](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.WalkSegmentModel.md))[] | Returns array of path segments. ||
|| [getType](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#getType)() | String | Returns ID of the route type. For public transport routes, the string "masstransit" is returned. ||
|| [update](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#update)([pathJson](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.masstransit.PathModel.md#update-param-pathJson)) | | Updates the state of the model. ||
|#

## Fields details {#field_detail}

### properties {#properties}

```javascript
{data.Manager} properties
```

Multiroute's path data. The following fields are available: 
- index: Integer - The sequential number of the path in the multiroute's corresponding route.
- type: String - Route type identifier, which takes the value "masstransit" 	for public transport 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.
- coordinates: Number[][] - Coordinates of all points on the path.
- encodedCoordinates: String - A string of base64-encoded coordinates for all points 	on the path.

### route {#route}

```javascript
{multiRouter.masstransit.RouteModel} route
```

Reference to the parent model of the route.

## Events details {#event_detail}

### update {#update}

Updating the model with new data. 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: 
- segmentsChange: Boolean - Flag for whether the set of segments is changed

## Methods details {#method_detail}

### destroy {#destroy}

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

Destroys a model.

### getSegments {#getSegments}

```javascript
{(multiRouter.masstransit.TransferSegmentModel|
multiRouter.masstransit.TransportSegmentModel|
multiRouter.masstransit.WalkSegmentModel)[]} getSegments()
```

**Returns** array of path segments.

### getType {#getType}

```javascript
{String} getType()
```

**Returns** ID of the route type. For public transport routes, the string "masstransit" is returned.

### update {#update}

```javascript
{} update(pathJson)
```

Updates the state of the model.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`pathJson`](#update-param-pathJson)[*](*star) | — | Type: Object

JSON data. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.