RoadSnappedLocationProvider.LocationListener

public static interface RoadSnappedLocationProvider.LocationListener

Defines signatures for methods that are called when road-snapped location updates become available. All notifications will occur on the UI thread.

Constant Summary

String IS_ROAD_SNAPPED_KEY Bundle key for the Location object returned in onLocationChanged(LocationEvent).

Public Method Summary

abstract void
onLocationChanged(LocationEvent event)
Called when the user's location is updated.
void
onRawLocationUpdate(LocationEvent event)
Called when raw location events are sent.

Constants

public static final String IS_ROAD_SNAPPED_KEY

Bundle key for the Location object returned in onLocationChanged(LocationEvent). When available, maps to a boolean value that indicates whether the location was snapped to the best available road. Note that this value may sometimes have hiccups and may differ from what aGMM UI shows. Retrieve the value with event.getLocation().getExtras().getBoolean(LocationListener.IS_ROAD_SNAPPED_KEY)

Constant Value: "is_road_snapped"

Public Methods

public abstract void onLocationChanged (LocationEvent event)

Called when the user's location is updated.

This is provided as frequently as possible by the location provider. Locations are only road-snapped when in driving mode, not when walking or cycling.

Parameters
event an event containing the driver's location. Contains IS_ROAD_SNAPPED Bundle key when information is available.

public void onRawLocationUpdate (LocationEvent event)

Called when raw location events are sent. Empirically, we sometimes see these when the road-snapped events are not sent.

Parameters
event an event containing the driver's location.