MapTrip SDK Android Manual 9.9.7
Itinerary Class Reference

Itinerary is an ordered sequence of waypoints that is the base for route calculations.
More...

+ Inheritance diagram for Itinerary:

Public Member Functions

native ApiError appendWaypoint (Waypoint wpt)
 
boolean equals (Object o)
 
native String getId ()
 
native String getName ()
 
native Iterable< WaypointgetWaypointIterator ()
 
native boolean hasStartPoint ()
 
native ApiError insertWaypoint (Waypoint wpt, int index)
 
 Itinerary ()
 
 Itinerary (Itinerary itn)
 
native ApiError loadFromFile (String xmlFilename)
 
native ApiError removeAll ()
 
native ApiError removeAt (int index)
 
native ApiError replaceWaypointAt (Waypoint wpt, int index)
 
native ApiError saveToFile (String xmlFilename, int indexStart, int indexEnd)
 
native ApiError setId (String id)
 
native ApiError setName (String name)
 

Detailed Description

A waypoint between start (first waypoint) and final destination (last waypoint) is called a destination or intermediate destination.
An itinerary for a navigation to a destination should contain the GPS position as first (use Waypoint.createCurrentGPSPosWaypoint() for this waypoint) and the destination as second or last waypoint.

Constructor & Destructor Documentation

◆ Itinerary() [1/2]

Itinerary ( )

Create an empty itinerary.

Returns
An empty itinerary

◆ Itinerary() [2/2]

Itinerary ( Itinerary  itn)

Creates a copy of the itinerary.

Member Function Documentation

◆ appendWaypoint()

native ApiError appendWaypoint ( Waypoint  wpt)

Append a copy of the given waypoint at the end of the itinerary.

Parameters
wpt- Waypoint to append
Returns
Errorcode

◆ equals()

boolean equals ( Object  o)
inherited

◆ getId()

native String getId ( )

Returns
Get the id of the itinerary.

◆ getName()

native String getName ( )

Returns
Get the name of the itinerary.

◆ getWaypointIterator()

native Iterable< Waypoint > getWaypointIterator ( )

Returns
iterator enumerating waypoints

◆ hasStartPoint()

native boolean hasStartPoint ( )

Returns true, if the first waypoint is a GPS position

◆ insertWaypoint()

native ApiError insertWaypoint ( Waypoint  wpt,
int  index 
)

Insert a copy of the waypoint before the element at a specific position in the itinerary.

Parameters
wpt- Waypoint to insert
index- insert position
Returns
Errorcode

◆ loadFromFile()

native ApiError loadFromFile ( String  xmlFilename)

Load an Itinerary from file. The format can be GPX, csv or MapTrip-internal XML. See Itinerary.saveToFile() If the itinerary is not empty, the loaded waypoints are append at the end. If you load the itinerary from a csv file and the csv file has only the columns "long" and "lat", every point of this file will be used. But if the csv file has the column "eventCode" too and if there are points with an eventCode=46000, only these points are used, the direction angle is set and the entire csv file is used as a reference route. If the csv file has the column "eventText", the name of the generated waypoint will be set by this optional column. You can get this name by Waypoint.getAliasName()

Parameters
xmlFilenameto load
Returns
Errorcode

◆ removeAll()

native ApiError removeAll ( )

Remove all waypoints from itinerary.

Returns
Errorcode

◆ removeAt()

native ApiError removeAt ( int  index)

Remove waypoint at specific position in itinerary.

Parameters
index- remove position
Returns
Errorcode

◆ replaceWaypointAt()

native ApiError replaceWaypointAt ( Waypoint  wpt,
int  index 
)

Replace a waypoint at specific position with a copy of the given waypoint in the itinerary.

Parameters
wpt- waypoint to insert
index- replace position
Returns
Errorcode

◆ saveToFile()

native ApiError saveToFile ( String  xmlFilename,
int  indexStart,
int  indexEnd 
)

A generated itinerary is saved to the specified file on disk either in custom xml format. See Itinerary.loadFromFile()

Parameters
xmlFilename- name of the desired file (use .xml ending to save in xml format or .gpx to store in GPX format)
indexStart- defines the first waypoint that will be saved to the xml-file out of the current itinerary.
indexEnd- defines the last waypoint that will be saved to the xml-file out of the current itinerary.
Returns
Errorcode

◆ setId()

native ApiError setId ( String  id)

Set the id of the itinerary.

Parameters
idto set
Returns
Errorcode

◆ setName()

native ApiError setName ( String  name)

Set the name of the itinerary.

Parameters
nameto set
Returns
Errorcode

The documentation for this class was generated from the following file: