public interface NavigationManager
Modifier and Type | Interface and Description |
---|---|
static class |
NavigationManager.Builder |
void initialize()
startNavigation(Route)
or any other method.void deinitialize()
void startNavigation(Route route)
Once navigation has started, the listener method NavigationStartStopListener.onNavigationStarted()
is called.
Note that if the Route
started cannot be navigated directly, given the user's current location,
the NavigationManager will automatically perform a "re-route" request using the the RouteService
-- and as a result of this action, will notify any listeners of the new route received by calling
RouteResponseListener.onRouteRetrieved(Route)
. The NavigationManager will then continue navigation using this new route.
route
- the route to navigate.void pauseNavigation()
To resume navigating, call resumeNavigation()
.
void resumeNavigation()
This method resumes navigation after a call to pauseNavigation()
.
void cancelNavigation()
Note that once the navigation session has been canceled, the listener method
NavigationStartStopListener.onNavigationStopped(RouteStoppedReason)
will be called
with a reason of RouteStoppedReason.ROUTE_CANCELED
.
boolean isStopped()
Note that if a NavigationStartStopListener
has been defined, when navigation stops
the listener method NavigationStartStopListener.onNavigationStopped(RouteStoppedReason)
is called
with an argument specifying the RouteStoppedReason
.
boolean isPaused()
Route getRoute()
Route
being navigated, or null if no route is active.RouteLeg getCurrentRouteLeg()
void addNavigationStartStopListener(NavigationStartStopListener listener)
void addAndNotifyNavigationStartStopListener(NavigationStartStopListener listener)
boolean removeNavigationStartStopListener(NavigationStartStopListener listener)
void addProgressListener(NavigationProgressListener listener)
void addAndNotifyProgressListener(NavigationProgressListener listener)
boolean removeProgressListener(NavigationProgressListener listener)
void addRouteResponseListener(RouteResponseListener listener)
boolean removeRouteResponseListener(RouteResponseListener listener)
void addTrafficResponseListener(TrafficResponseListener listener)
boolean removeTrafficResponseListener(TrafficResponseListener listener)
void addSpeedLimitSpanListener(SpeedLimitSpanListener listener)
void addAndNotifySpeedLimitSpanListener(SpeedLimitSpanListener listener)
boolean removeSpeedLimitSpanListener(SpeedLimitSpanListener listener)
void addPromptListener(PromptListener listener)
boolean removePromptListener(PromptListener listener)
void addEtaResponseListener(EtaResponseListener etaResponseListener)
boolean removeEtaResponseListener(EtaResponseListener etaResponseListener)
LocationProviderAdapter getLocationProviderAdapter()
When navigating a Route
using the NavigationManager, the user's location updates are provided to the SDK
by a location provider. The abstract class LocationProviderAdapter
in the SDK provides a generic "wrapper" for any
location-provider of your choice -- for example, a native Google location service, a "mocked" location-provider
(e.g. used during testing), or one of the commonly used 3rd-party location libraries such as
Mapzen Lost.
The Navigation SDK Reference Sample Application provides an example implementation using the Mapzen Lost location provider library, named MapzenLocationProviderAdapter -- please refer to the documentation for more details on the LocationProviderAdapter and the implementation of the example MapzenLocationProviderAdapter.
LocationProviderAdapter
being used.