public static interface

CoreApi.Routing

com.mapsted.positioning.CoreApi.Routing

Class Overview

Use RoutingManager to get routing related information and functionalities

Summary

Public Methods
abstract boolean addRoutingRequestListener(RoutingRequestCallback listener)
Register listener for RoutingRequestCallback events
abstract boolean addRoutingStatusListener(RoutingStatusCallback listener)
Register listener for RoutingStatusCallback events
abstract RouteNode getCurrentInstruction()
Get current navigation instruction.
abstract Route getCurrentRoute()
abstract void getDistanceTimeEstimate(SearchEntity searchEntity, RouteOptions routeOptions, Consumer<DistanceTime> callback)
Get DistanceTime from current location to SearchEntity based on specified routing options
abstract void getDistanceTimeEstimate(IMercatorZone destination, RouteOptions routeOptions, Consumer<DistanceTime> callback)
Get DistanceTime from current location to a specified destination based on specified routing options.
abstract void getDistanceTimeEstimate(IMercatorZone start, IMercatorZone destination, RouteOptions routeOptions, Consumer<DistanceTime> callback)
Get DistanceTime from specified start and destination based on specified routing options.
abstract boolean removeRoutingRequestListener(RoutingRequestCallback listener)
Unregister listener for RoutingRequestCallback events
abstract boolean removeRoutingStatusListener(RoutingStatusCallback listener)
Unregister listener for RoutingStatusCallback events
abstract void requestRouting(RouteRequest request, RoutingRequestCallback callback)
Request a routing.
abstract void startNavigation(Route route, RoutingStatusCallback callback)
Start navigation process.
abstract void stopNavigation()
Stop navigation process.

Public Methods

public abstract boolean addRoutingRequestListener (RoutingRequestCallback listener)

Register listener for RoutingRequestCallback events

Parameters
listener listener
Returns
  • whether or not successful

public abstract boolean addRoutingStatusListener (RoutingStatusCallback listener)

Register listener for RoutingStatusCallback events

Parameters
listener listener
Returns
  • whether or not successful

public abstract RouteNode getCurrentInstruction ()

Get current navigation instruction.

Call this function to get the latest navigation instruction. This function need to be called inside navigation mode. Assume startNavigation(Route, RoutingStatusCallback) is already called.

Returns
  • A routing instruction contains a double value indicates the map rotation angle, and a set of route information.

public abstract Route getCurrentRoute ()

public abstract void getDistanceTimeEstimate (SearchEntity searchEntity, RouteOptions routeOptions, Consumer<DistanceTime> callback)

Get DistanceTime from current location to SearchEntity based on specified routing options

Parameters
searchEntity Destination search entity. See SearchEntity
routeOptions Estimated distance in meters and time in minutes. See RouteOptions
callback callback with DistanceTime in meters and time in minutes. See DistanceTime

public abstract void getDistanceTimeEstimate (IMercatorZone destination, RouteOptions routeOptions, Consumer<DistanceTime> callback)

Get DistanceTime from current location to a specified destination based on specified routing options.

Parameters
destination Location of the destination. See IMercatorZone
routeOptions Routing options to be used. See RouteOptions
callback callback with DistanceTime in meters and time in minutes. See DistanceTime

public abstract void getDistanceTimeEstimate (IMercatorZone start, IMercatorZone destination, RouteOptions routeOptions, Consumer<DistanceTime> callback)

Get DistanceTime from specified start and destination based on specified routing options.

Parameters
start Location of the start. See IMercatorZone
destination Location of the destination. See IMercatorZone
routeOptions Routing options to be used. See RouteOptions
callback callback with DistanceTime in meters and time in minutes. See DistanceTime

public abstract boolean removeRoutingRequestListener (RoutingRequestCallback listener)

Unregister listener for RoutingRequestCallback events

Parameters
listener listener
Returns
  • whether or not successful

public abstract boolean removeRoutingStatusListener (RoutingStatusCallback listener)

Unregister listener for RoutingStatusCallback events

Parameters
listener listener
Returns
  • whether or not successful

public abstract void requestRouting (RouteRequest request, RoutingRequestCallback callback)

Request a routing. The response will be in the callback which could be a success or an error.

Parameters
request The routing request. See RouteRequest
callback A callback for routing navigation. See RoutingRequestCallback

Setup a RoutingRequestCallback for routing navigation. The routing callback handles the routing request, routing response, latest routing response's status, routing instructions and how to recalculate after a new routing response.

public abstract void startNavigation (Route route, RoutingStatusCallback callback)

Start navigation process.

It will call core library to start navigation.

See Also

public abstract void stopNavigation ()

Stop navigation process.

It will call core library to stop navigation process.