ElectronicHorizonEngine

public class ElectronicHorizonEngine
extension ElectronicHorizonEngine: NativeBase
extension ElectronicHorizonEngine: Hashable

Provides an electronic horizon engine that continuously predicts the road network ahead of the vehicle by using detailed map data, including road topography that is currently out of sight. You can subscribe to electronic horizon updates based on position updates by using ElectronicHorizonDelegate. For more information about sub path levels, see ElectronicHorizonOptions.lookAheadDistancesInMeters.

The electronic horizon engine uses map-matched locations and can optionally use a Route to improve the most-preferred path (MPP).

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • Creates a new instance of ElectronicHorizonEngine.

    Throws

    InstantiationError InstantiationError If the electronic horizon engine cannot be created.

    Declaration

    Swift

    public init(sdkEngine: SDKNativeEngine, options: ElectronicHorizonOptions, transportMode: TransportMode, route: Route?) throws

    Parameters

    sdkEngine

    The SDKNativeEngine instance that provides shared services, such as networking and map data.

    options

    The ElectronicHorizonOptions instance that configures how the electronic horizon is calculated, including look-ahead distances.

    transportMode

    The TransportMode that is used when building the electronic horizon paths.

    route

    The Route that improves the calculation of the most-preferred path (MPP). If nil is passed, the most-preferred path can deviate from the route.

  • The instance of Route that is being used by ElectronicHorizonEngine. You can override this property to rebuild the electronic horizon based on a different route.

    Declaration

    Swift

    public var route: Route? { get set }
  • Updates the electronic horizon paths based on the provided map-matched location. This method returns immediately and does not block. When internal calculation is complete, callbacks are called on the main thread. When multiple updates are triggered while processing is still running, intermediate locations are skipped and only the last location is processed.

    Declaration

    Swift

    public func update(mapMatchedLocation: MapMatchedLocation)

    Parameters

    mapMatchedLocation

    The map-matched location that defines the current vehicle position on the road network.

  • Adds an ElectronicHorizonDelegate to the subscription list.

    Declaration

    Swift

    public func addElectronicHorizonDelegate(_ electronicHorizonListener: ElectronicHorizonDelegate)

    Parameters

    electronicHorizonListener

    The listener that receives electronic horizon path updates.

  • Removes an ElectronicHorizonDelegate from the subscription list.

    Declaration

    Swift

    public func removeElectronicHorizonDelegate(_ electronicHorizonListener: ElectronicHorizonDelegate)

    Parameters

    electronicHorizonListener

    The listener that should no longer receive electronic horizon path updates.