This class enables Route calculations and Route Guidance
More...
Inheritance diagram for Navigation:Public Member Functions | |
| void | addTaskListener (TaskListener listener) |
| Task< Void > | calculateRoute () |
| Task< Void > | calculateRoutes (final int numRoutes) |
| String | copyCurrentRoute () |
| boolean | equals (Object o) |
| native FollowMeRoute | getInjectedFollowMeRoute () |
| native Itinerary | getItinerary () |
| String | getNextCrosswayGeometry (final NavGeometryFormat format) |
| Iterable< Polygon > | getRouteExtents (final boolean fromCurrentRoute, final boolean currentRouteFromCurrentPosition, final double lengthInMeters) |
| Navigation | getRouteNumber (final int routeNumber) |
| int | getRouteStatistic (final NavRouteStatistic statisticitem, final int firstStop, final int lastStop) |
| native ApiError | injectFollowMeRoute (FollowMeRoute fmr) |
| Navigation () | |
| void | removeAllTaskListeners () |
| void | removeTaskListener (TaskListener listener) |
| native ApiError | setItinerary (Itinerary itn) |
| Task< Void > | setRoute (final String fileName) |
| ApiError | setSimulationPosOnRoute (final double posOnRoute) |
| ApiError | startNavigation () |
| ApiError | startSimulatedNavigation () |
The Navigation class allow route calculation based on Itineraries. These Routes can be
The route calculation is an asynchronous process. A call to Navigation.calculateRoute() will return a Task object. The Navigation instance provides a set of listeners which can be registered and which provide information on the progress ( TaskListener.taskProgress() ) and finished state ( TaskListener.taskFinished() )
A task for a routing process can be created in different scenarios:
Each navigation instance can have one callback for the task progress and finished events. Therefore tasks can be compared with the isIdentical method For example: The task initiated with Navigation.calculateRoute() can be stored and compared to the task received in the TaskListener.taskFinished() to differ initial routing results from rerouting results.
| Navigation | ( | ) |
|
static |
| void addTaskListener | ( | TaskListener | listener | ) |
| Task< Void > calculateRoute | ( | ) |
Calculates a route based on the Itinerary
@arg @ref MTA_ERROR "ApiError.WARNING_ROUTE_OBST_FOUND" The route contains one or more obstacles
| Task< Void > calculateRoutes | ( | final int | numRoutes | ) |
Calculates numRoutes routes based on the Itinerary
@arg @ref MTA_ERROR "ApiError.WARNING_ROUTE_OBST_FOUND" The route contains one or more obstacles
| String copyCurrentRoute | ( | ) |
Copy the route shape of the currently active navigation. This can be used as an argument for mta_nav_setRoute() to syncronized two Navigation instances.
|
inherited |
|
static |
|
static |
|
static |
|
static |
| native FollowMeRoute getInjectedFollowMeRoute | ( | ) |
Returns the FollowMeRoute, that is injected by Navigation.injectFollowMeRoute() If no FollowMeRoute was injected, ApiError.OBJ_NOT_FOUND is returned.
| native Itinerary getItinerary | ( | ) |
|
static |
|
static |
Get german vignette type (Umweltzonenplakettentyp) for low emission zones routing.
| String getNextCrosswayGeometry | ( | final NavGeometryFormat | format | ) |
Returns the geometry of the next crossway of interest of an active guidance.
| format | - The format of the result (see NavGeometryFormat) |
| Iterable< Polygon > getRouteExtents | ( | final boolean | fromCurrentRoute, |
| final boolean | currentRouteFromCurrentPosition, | ||
| final double | lengthInMeters | ||
| ) |
| fromCurrentRoute- | true to calculate the extend only for the current interstation, false to calculate over all interstations |
| currentRouteFromCurrentPosition | - true to calculate the extend from the current position, false to calculate for the whole route |
| lengthInMeters | - maximum route length in meters that the extend will cover |
| Navigation getRouteNumber | ( | final int | routeNumber | ) |
Returns a new navigation object with the given route (routeNumber) selected.
| rootNavHandle | - The navigation handle on which multiple routes have been calculated |
| rootNumber | - The route number to select (beginning with 0) |
|
static |
Get the emergency routing (reckless driving) radius in meters.
| int getRouteStatistic | ( | final NavRouteStatistic | statisticitem, |
| final int | firstStop, | ||
| final int | lastStop | ||
| ) |
Calculates a statistic of a selected type (e.g. fuel consumption or route length) for a specific start Waypoint to a specific end Waypoint in the Itinerary.
| statisticitem | - Defines which statistic item shall be calculated like driving time or route length (see NavRouteStatistic) |
| firstStop | - Index of the first Waypoint in the Itinerary that shall be included in the statistic calculations. |
| lastStop | - Index of the last Waypoint in the Itinerary that shall be included in the statistic calculations |
|
static |
See Navigation.setRouteUseOffboardTraffic() for a detailed description.
|
static |
Retrieves the (offboard) routing context for navigation
|
static |
| native ApiError injectFollowMeRoute | ( | FollowMeRoute | fmr | ) |
Instead of setting an itinerary, you may inject a FollowMeRoute as a "destination". If you start a Navigation with an injected FollowMeRoute, some things change:
| fmr | - the FollowMeRoute, that should be injected. |
|
static |
|
static |
| void removeAllTaskListeners | ( | ) |
|
static |
|
static |
Releases the blocking performed by Navigation.blockRouteBySelection().
| void removeTaskListener | ( | TaskListener | listener | ) |
|
static |
Sets the allowed routing sites.
| computationSite | See ComputationSite |
| itn | - the itinerary for the navigation. It is not possible to change the itinerary of the running navigation. Call mta_nav_stopNavigation before. |
|
static |
| lezEnabled | - true to enable low emission zones routing |
|
static |
| lezVignette | type of the german Vignette (Umweltzonenplakettentyp) that will be respected by routing |
| Task< Void > setRoute | ( | final String | fileName | ) |
Use this function instead of Navigation.calculateRoute(), if you have already an advised route from a iwRouting server. This function opens the route (with the path, provided by the fileName parameter), creates an itinerary with the first an the last point of the route file and does some internal wiring to handle this route as an ordinary calculated route. Beware, that there will only survive the destination, if a rerouting occours.
|
static |
| avoid | if true the routing will avoid Ferries. If set while a navigation is running a re-routing will be started. |
|
static |
| avoid | if true the routing will avoid highways. If set while a navigation is running a re-routing will be started. |
|
static |
| avoid | if true the routing will avoid Toll routes. If set while a navigation is running a re-routing will be started. |
|
static |
Set the emergency routing (reckless driving) radius in meters. If set while a navigation is running a re-routing will be started.
When set to a value greater then 0, forbidden maneuvers and one-way streets that lie within the given radius around the destination are ignored, i.e. can be used for navigation. When set to 0 then emergency routing is deactivated. This functionality is intended for police or emergency services to reach the location of an emergency as fast as possible.
| recklessRadiusMeters |
|
static |
If you have a license for offboard route calculation, the SDK will get all routes from the infoware routing servers. These servers take by default the current traffic for the route calculation into account. With this setter, you may switch off the usage of the traffic information. Then, the routing server will only use statistical traffic information for every further route calculation, unless you switch it on again. Be aware, that this setting will be persisted in the settings.ini (section '[ROUTING]', key name 'UseOffboardTraffic') and therefore is still active after a new start of your application.
| use | if false, the offboard routing will not take the current traffic for the route calculation into account. |
|
static |
Sets the (offboard) routing context for navigation
| routingContext | See RoutingContext |
|
static |
Sets the routing objective for navigation
| routingType | See RoutingType |
| ApiError setSimulationPosOnRoute | ( | final double | posOnRoute | ) |
Sets the start position of the next OR current simulated navigation
| ApiError startNavigation | ( | ) |
Non-blocking call
Starts the navigation (route guidance) process. If a navigation shall be started based on a GPS log see Gps.
| ApiError startSimulatedNavigation | ( | ) |
The navigation is started along the calculated route with a fake GPS signal along the calculated route.
This feature is meant to be used for development and debugging purpose.
|
static |
Stops the navigation (route guidance) process
|
static |
Stops the simulated navigation.