Skip to main content

Itinerary

wemap-sdk-js


Class: Itinerary

Main attributes are: nodes: the ordered list of Node edges: the ordered list of Edge start: the start point (Coordinates) end: the end point (Coordinates) length: the route length

Constructors​

Constructor​

new Itinerary(__namedParameters): Itinerary

Parameters​

__namedParameters​

ItineraryConstructor

Returns​

Itinerary

Properties​

destination​

destination: Coordinates


duration​

duration: number


endTime​

endTime: number | null


legs​

readonly legs: Leg[]


origin​

origin: Coordinates


startTime​

startTime: number | null

Accessors​

coords​

Get Signature​

get coords(): Coordinates[]

Returns​

Coordinates[]

Set Signature​

set coords(_): void

Parameters​
_​

Coordinates[]

Returns​

void


distance​

Get Signature​

get distance(): number

Returns​

number

Set Signature​

set distance(_): void

Parameters​
_​

number

Returns​

void


price​

Get Signature​

get price(): number

Returns​

number

Set Signature​

set price(_): void

Parameters​
_​

number

Returns​

void


steps​

Get Signature​

get steps(): Step[]

Returns​

Step[]

Set Signature​

set steps(_): void

Parameters​
_​

Step[]

Returns​

void


transitMode​

Get Signature​

get transitMode(): TransitMode

Returns​

TransitMode

Set Signature​

set transitMode(_): void

Parameters​
_​

TransitMode

Returns​

void

Methods​

equals()​

equals(obj): boolean

Parameters​

obj​

Itinerary

Returns​

boolean


forceUnknownLevelTo0()​

forceUnknownLevelTo0(): void

Returns​

void


multiplyLevel()​

multiplyLevel(levelFactor): void

Parameters​

levelFactor​

number

Returns​

void


toGeoJson()​

toGeoJson(): FeatureCollection

Returns​

FeatureCollection


toGraph()​

toGraph(): Graph

Returns​

Graph


toJson()​

toJson(): ItineraryJson

Returns​

ItineraryJson


updateStepsFromLegs()​

updateStepsFromLegs(): void

TODO: Remove it in router v3 Update steps info thanks to the coordinates of the whole itinerary. This method will update:

  • all steps number
  • first/last steps
  • previousBearing/nextBearing/angle of first and last step of each leg
  • distance/duration of first and last step of each leg
  • remove type depart | arrive if step is not first or last

Returns​

void


equals()​

static equals(obj1, obj2): boolean

Parameters​

obj1​

Itinerary

obj2​

Itinerary

Returns​

boolean


fromGraphRoute()​

static fromGraphRoute(graphRoute, transitMode?): Itinerary

Parameters​

graphRoute​

GraphRoute

transitMode?​

TransitMode = 'WALK'

Returns​

Itinerary


fromItineraries()​

static fromItineraries(...itineraries): Itinerary

Parameters​

itineraries​

...Itinerary[]

Returns​

Itinerary


fromJson()​

static fromJson(json): Itinerary

Parameters​

json​

ItineraryJson

Returns​

Itinerary


fromOrderedCoordinates()​

static fromOrderedCoordinates(coords, origin, destination, transitMode?): Itinerary

Convert ordered Coordinates to Itinerary

Parameters​

coords​

Coordinates[]

origin​

Coordinates

destination​

Coordinates

transitMode?​

TransitMode = 'WALK'

Returns​

Itinerary


fromOrderedPointsArray()​

static fromOrderedPointsArray(points, start, end, transitMode?): Itinerary

Convert lat/lng/level? points to Itinerary

Parameters​

points​

(Point2_t | Vector3_t)[]

start​

Point2_t | Vector3_t

end​

Point2_t | Vector3_t

transitMode?​

TransitMode = 'WALK'

Returns​

Itinerary