HorizonDataAdapter

public protocol HorizonDataAdapter

Interface to a horizon data adapter that provides Horizon data objects within requested bounding boxes.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • The type of data this dataAdapter provides.

    Declaration

    Swift

    var type: HorizonDataType { get }
  • Add an observable object for data change. The observer should be kept with weak reference in data source implementation.

    Declaration

    Swift

    func addObserver(_ observer: HorizonDataChangedObserver)

    Parameters

    observer

    The observer that is used to listen for data updates.

  • Remove an observable object for data change.

    Declaration

    Swift

    func removeObserver(_ observer: HorizonDataChangedObserver)

    Parameters

    observer

    The observer to remove from the data source.

  • Subscribe to an array of areas on the map for which hazard or safety location information would be observed. Subscribed data could be retrieved by the snapshot method of data adapter.

    Declaration

    Swift

    func subscribe(toBoundingBoxes boundingBoxes: [BoundingBox])

    Parameters

    boundingBoxes

    Array of rectangular areas on the map. The areas are represented by coordinates of two corners.

  • Unsubscribe from a list of previously subscribed areas on the map for which hazard information is no longer needed.

    Declaration

    Swift

    func unsubscribe(fromBoundingBoxes boundingBoxes: [BoundingBox])

    Parameters

    boundingBoxes

    Array of rectangular areas on the map. The areas are represented by coordinates of two corners.