Class: IWRoute

IWRoute

A class representing a route

This class is part of the module routing.


new IWRoute()

Creates a new route

Methods


addEntry(entry)

Adds a new entry to the route.
Parameters:
Name Type Description
entry IWRouteEntry
Returns:
Type
void

findNearestCoordinateIndex(coordinate)

Returns the index of the coordinate on the route which is nearest to the specified coordinate.
Parameters:
Name Type Description
coordinate IWCoordinate a coordinate
Returns:
the index for route.getCoordinates()
Type
number

findNearestItineraryIndex(coordinate)

Returns the index of the itinerary where the specified coordinate should be inserted, or -1 if it should be appended.
Parameters:
Name Type Description
coordinate IWCoordinate a coordinate
Returns:
the index for IWRoutingManager.getItinerary()
Type
number

getBounds()

Returns the bounds of this route.
Returns:
Type
IWBounds

getCoordinates()

Returns the geometry of the route as an array of coordinates.
Returns:
Type
Array.<IWCoordinate>

getDestinationAddress()

Returns the destination address.
Returns:
Type
IWAddress

getDrivingTime()

Returns the driving time in seconds.
Returns:
Type
number

getEntry(index)

Returns the route entry at the specified index.
Parameters:
Name Type Description
index number
Returns:
Type
IWRouteEntry

getFormattedDrivingTime()

Returns the driving time formatted as a string.
Returns:
the driving time
Type
number

getFormattedRouteLength()

Returns the route length formatted as a string.
Returns:
the length of the route
Type
number

getFuelConsumption()

Returns the total fuel consumption in liters.
Returns:
Type
Number

getInterstationAddresses()

Returns the interstation addresses.
Returns:
Type
Array.<IWAddress>

getRouteLength()

Returns the total route length in kilometers.
Returns:
Type
Number

getSegments()

Returns the number of route entries.
Returns:
Type
number

getShape()

Returns the name of the shape file
Deprecated:
  • Yes
Returns:
Type
void

getStartAddress()

Returns the start address.
Returns:
Type
IWAddress

setBounds(bounds)

Sets the bounds of this route.
Parameters:
Name Type Description
bounds IWBounds
Returns:
Type
void

setCoordinates(coordinates)

Sets the geometry of the route as an array of coordinates.
Parameters:
Name Type Description
coordinates Array.<IWCoordinate> the coordinates
Returns:
Type
void

setDestinationAddress(destinationAddress)

Sets the destination address.
Parameters:
Name Type Description
destinationAddress IWAddress
Returns:
Type
void

setDrivingTime(drivingTime)

Sets the driving time in seconds.
Parameters:
Name Type Description
drivingTime number
Returns:
Type
void

setFormattedDrivingTime(formattedDrivingTime)

Sets the driving time formatted as a string.
Parameters:
Name Type Description
formattedDrivingTime number the driving time
Returns:
Type
void

setFormattedRouteLength(formattedRouteLength)

Sets the route length formatted as a string.
Parameters:
Name Type Description
formattedRouteLength number the length of the route
Returns:
Type
void

setFuelConsumption(fuelConsumption)

Sets the total fuel consumption in liters.
Parameters:
Name Type Description
fuelConsumption Number
Returns:
Type
void

setInterstationAddresses(interstationAddresses)

Sets the interstation addresses.
Parameters:
Name Type Description
interstationAddresses Array.<IWAddress> interstationAddresses
Returns:
Type
void

setRouteLength(routeLength)

Sets the total route length in kilometers.
Parameters:
Name Type Description
routeLength Number
Returns:
Type
void

setShape(shape)

Sets the name of the shape file.
Parameters:
Name Type Description
shape String
Deprecated:
  • Yes
Returns:
Type
void

setStartAddress(startAddress)

Sets the start address.
Parameters:
Name Type Description
startAddress IWAddress
Returns:
Type
void

toString()

Returns a string representation of this object.
Returns:
Type
String