NavigationHorizonObserver

public protocol NavigationHorizonObserver : Observer

Declares an observer that can receive navigation horizon events.

Horizon information is updated with each location update.

To use this observer, implement the protocol:

class CustomNavigationHorizonObserver: NavigationHorizonObserver {

    func didUpdateSnapshot(options: HorizonOptions, snapshot: HorizonSnapshot) {
        // Handle the updated horizon snapshot.
    }

    func didUpdatePosition(options: HorizonOptions, position: HorizonPosition) {
        // Handle the updated horizon position.
    }

    func didResetHorizon(options: HorizonOptions) {
        // Handle the horizon reset.
    }
}

To add a NavigationHorizonObserver, use addHorizonObserver(_:options:). To stop receiving these events, remove the observer using removeHorizonObserver(_:).

  • Notifies that a horizon snapshot has been updated for a specific set of horizon options.

    Declaration

    Swift

    func didUpdateSnapshot(options: HorizonOptions, snapshot: HorizonSnapshot)

    Parameters

    options

    The horizon options.

    snapshot

    The updated horizon snapshot.

  • Notifies that a horizon position has been updated for a specific set of horizon options.

    Declaration

    Swift

    func didUpdatePosition(options: HorizonOptions, position: HorizonPosition)

    Parameters

    options

    The horizon options.

    position

    The updated horizon position.

  • Reports that the horizon was reset for a specific set of horizon options. A horizon reset occurs following:

    • A map update
    • A vehicle profile update
    • A route update
    • A language update
    • When the current input position does not belong to any of the existing horizon paths (for example, a jump to a new place).

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    func didResetHorizon(options: HorizonOptions)

    Parameters

    options

    The horizon options.