GoogleNavigation Framework Reference

  • GMSRoadSnappedLocationProviderListener is a protocol for receiving events from the GMSRoadSnappedLocationProvider.

  • The locationProvider:didUpdateLocation: method is called frequently with the device's current location, road-snapped when in driving mode.

  • If location properties are unavailable, they are set to specific invalid values like kCLLocationCoordinate2DInvalid for coordinate, NAN for altitude, and -1 for accuracy, course, and speed.

  • This method will not be called if the necessary terms and conditions have not been accepted by the user.

GMSRoadSnappedLocationProviderListener

@protocol GMSRoadSnappedLocationProviderListener <NSObject>

Listener for events on GMSRoadSnappedLocationProvider.

  • Called when the device’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.

    If any of the location properties are unavailable, they are set to the following values: coordinate: kCLLocationCoordinate2DInvalid altitude: NAN horizontalAccuracy: -1 verticalAccuracy: -1 course: -1 speed: -1

    Note that this method will not be called if the terms and conditions have not been accepted.

    Declaration

    Swift

    func locationProvider(_ locationProvider: GMSRoadSnappedLocationProvider, didUpdate location: CLLocation)

    Objective-C

    - (void)locationProvider:
                (nonnull GMSRoadSnappedLocationProvider *)locationProvider
           didUpdateLocation:(nonnull CLLocation *)location;