Map Libre Navigation
A MapLibreNavigation class for interacting with and customizing a navigation session.
Instance of this class are used to setup, customize, start, and end a navigation session. Building a custom MapLibreNavigationOptions object and passing it in allows you to further customize the user experience. Once this class is initialized, the options specified through the options class cannot be modified.
Parameters
required in order to create and bind the navigation service. An application context is required here.
a custom built MapLibreNavigationOptions class
a LocationEngine to provide Location updates
Navigation uses a camera engine to determine the camera position while routing. By default, it uses a SimpleCamera. If you would like to customize how the camera is positioned, create a new Camera and set it here.
This parameter is used to pass in a custom implementation of the snapping logic. A default snap-to-route engine is attached when this class is first initialized; setting a custom one will replace it with your own implementation.
This param is used to pass in a custom implementation of the off-route logic, A default off-route detection engine is attached when this class is first initialized; setting a custom one will replace it with your own implementation.
This API is used to pass in a custom implementation of the faster-route detection logic, A default faster-route detection engine is attached when this class is first initialized; setting a custom one will replace it with your own implementation.
core utility class for route related calculations
See also
Inheritors
Constructors
Properties
Navigation needs an instance of location engine in order to acquire user location information and handle events based off of the current information. By default, a LOST location engine is created with the optimal navigation settings.
Functions
This adds a new faster route listener which is invoked when a new, faster DirectionsRoute has been retrieved by the specified criteria in FasterRoute.
Navigation Milestones provide a powerful way to give your user instructions at custom defined locations along their route. Default milestones are automatically added unless MapLibreNavigationOptions.defaultMilestonesEnabled is set to false but they can also be individually removed using the .removeMilestone API. Once a custom milestone is built, it will need to be passed into the navigation SDK through this method.
This adds a new milestone event listener which is invoked when a milestone gets triggered. If more then one milestone gets triggered on a location update, each milestone event listener will be invoked for each of those milestones. This is important to consider if you are using voice instructions since this would cause multiple instructions to be said at once. Ideally the milestones setup should avoid triggering too close to each other.
Adds the given list of Milestone to be triggered during navigation.
This adds a new navigation event listener which is invoked when navigation service begins running in the background and again when the service gets destroyed.
This adds a new off route listener which is invoked when the devices location veers off the route and the specified criteria's in MapLibreNavigationOptions have been met.
This adds a new progress change listener which is invoked when a location change occurs and the navigation engine successfully runs it's calculations on it.
This removes a specific faster route listener by passing in the instance of it or you can pass in null to remove all the listeners. When .onDestroy is called, all listeners get removed automatically, removing the requirement for developers to manually handle this.
Remove a specific milestone by passing in the identifier associated with the milestone you'd like to remove. If the identifier passed in does not match one of the milestones in the list, a warning will return in the log.
Remove a specific milestone by passing in the instance of it. Removal of all the milestones can be achieved by passing in null rather than a specific milestone.
This removes a specific milestone event listener by passing in the instance of it or you can pass in null to remove all the listeners. When .onDestroy is called, all listeners get removed automatically, removing the requirement for developers to manually handle this.
This removes a specific navigation event listener by passing in the instance of it or you can pass in null to remove all the listeners. When .onDestroy is called, all listeners get removed automatically, removing the requirement for developers to manually handle this.
This removes a specific off route listener by passing in the instance of it or you can pass in null to remove all the listeners. When .onDestroy is called, all listeners get removed automatically, removing the requirement for developers to manually handle this.
This removes a specific progress change listener by passing in the instance of it or you can pass in null to remove all the listeners. When .onDestroy is called, all listeners get removed automatically, removing the requirement for developers to manually handle this.
Calling This begins a new navigation session using the provided directions route. this API is also intended to be used when a reroute occurs passing in the updated directions route.
Call this when the navigation session needs to end before the user reaches their final destination. There isn't a need to manually end the navigation session using this API when the user arrives unless you set MapLibreNavigationOptions.manuallyEndNavigationUponCompletion to true.