On-demand Rides and Deliveries Solution is currently available only to select partners. Contact sales to learn more.

Simulator

Stay organized with collections Save and categorize content based on your preferences.
public interface Simulator

An interface to send simulated locations to the Nav API, or run the Nav API along simulated routes. For use during testing, debugging and demos.

Implementations of this interface are thread-safe.

Public Method Summary

abstract void
hideDummyTrafficPrompt()
Hides the dummy traffic prompt, if one was shown.
abstract void
pause()
Pauses simulation.
abstract void
resume()
Resumes simulation, following a pause.
abstract void
setUserLocation(LatLng location)
Sets a simulated user location.
abstract void
showDummyTrafficPrompt()
Shows a dummy traffic prompt.
abstract void
simulateLocationsAlongExistingRoute()
Begins simulating travel along the route currently calculated by the Navigator.
abstract void
simulateLocationsAlongExistingRoute(SimulationOptions options)
Begins simulating travel along the route currently calculated by the Navigator.
abstract ListenableResultFuture<Navigator.RouteStatus>
simulateLocationsAlongNewRoute(List<Waypoint> waypoints, RoutingOptions routingOptions)
Calculates a route through the given waypoints (as would be calculated by Navigator.setDestinations()), and simulate travel along this route.
abstract ListenableResultFuture<Navigator.RouteStatus>
simulateLocationsAlongNewRoute(List<Waypoint> waypoints)
Calculates a route through the given waypoints (as would be calculated by Navigator.setDestinations()), and simulate travel along this route.
abstract ListenableResultFuture<Navigator.RouteStatus>
simulateLocationsAlongNewRoute(List<Waypoint> waypoints, RoutingOptions routingOptions, SimulationOptions simulationOptions)
Calculates a route through the given waypoints (as would be calculated by Navigator.setDestinations()), and simulate travel along this route.
abstract void
unsetUserLocation()
Stops simulating user location.

Public Methods

public abstract void hideDummyTrafficPrompt ()

Hides the dummy traffic prompt, if one was shown.

public abstract void pause ()

Pauses simulation.

public abstract void resume ()

Resumes simulation, following a pause.

public abstract void setUserLocation (LatLng location)

Sets a simulated user location.

Parameters
location

public abstract void showDummyTrafficPrompt ()

Shows a dummy traffic prompt. Useful for testing the prompt UI.

This method only works if guidance is running.

public abstract void simulateLocationsAlongExistingRoute ()

Begins simulating travel along the route currently calculated by the Navigator. If the Navigator has not calculated a route, this does nothing.

Simulation will be run using the default SimulationOptions.

public abstract void simulateLocationsAlongExistingRoute (SimulationOptions options)

Begins simulating travel along the route currently calculated by the Navigator. If the Navigator has not calculated a route, this does nothing.

Parameters
options

public abstract ListenableResultFuture<Navigator.RouteStatus> simulateLocationsAlongNewRoute (List<Waypoint> waypoints, RoutingOptions routingOptions)

Calculates a route through the given waypoints (as would be calculated by Navigator.setDestinations()), and simulate travel along this route. Travel will be started just before the future returns OK. If the future returns anything except OK, nothing will be simulated.

Simulation will be run using the default SimulationOptions.

Parameters
waypoints
routingOptions

public abstract ListenableResultFuture<Navigator.RouteStatus> simulateLocationsAlongNewRoute (List<Waypoint> waypoints)

Calculates a route through the given waypoints (as would be calculated by Navigator.setDestinations()), and simulate travel along this route. Travel will be started just before the future returns OK. If the future returns anything except OK, nothing will be simulated.

The route will be calculated using the default RoutingOptions.

Simulation will be run using the default SimulationOptions.

Parameters
waypoints

public abstract ListenableResultFuture<Navigator.RouteStatus> simulateLocationsAlongNewRoute (List<Waypoint> waypoints, RoutingOptions routingOptions, SimulationOptions simulationOptions)

Calculates a route through the given waypoints (as would be calculated by Navigator.setDestinations()), and simulate travel along this route. Travel will be started just before the future returns OK. If the future returns anything except OK, nothing will be simulated.

Parameters
waypoints
routingOptions
simulationOptions

public abstract void unsetUserLocation ()

Stops simulating user location. This will also end any active simulation.