SegmentDataLoader

public class SegmentDataLoader
extension SegmentDataLoader: NativeBase
extension SegmentDataLoader: Hashable

Provides the protocol for the access to the segments data available in the local OCM map. Please be aware that the methods within this class load map data synchronously. In the event of absent data in the disk cache, the data will be retrieved from the remote server. To mitigate the potential freezing of the calling thread, it is advisable to proactively prefetch map data around the working area.

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 this class.

    Throws

    InstantiationError Indicates what went wrong when the instantiation was attempted.

    Declaration

    Swift

    public init() throws
  • Creates a new instance of this class.

    Throws

    InstantiationError Indicates what went wrong when the instantiation was attempted.

    Declaration

    Swift

    public init(sdkEngine: SDKNativeEngine) throws

    Parameters

    sdkEngine

    A SDKEngine instance.

  • Loads the segments around a certain coordinates. Returns an empty list in case no segments could be found around the coordinates.

    Throws

    MapDataLoaderError Specifies reason, why list of a list of segments is not returned.

    Declaration

    Swift

    public func getSegmentsAroundCoordinates(_ coordinates: GeoCoordinates, radiusInMeters: Double) throws -> [OCMSegmentId]

    Parameters

    coordinates

    The location to explore

    radiusInMeters

    The radius of the search. Only values between 1m and 5000m are accepted.

    Return Value

    The list of segments around the given position. The segments are sorted by distance from the point. Throws if it’s not possible to return list of a list of segments.

  • Synchronously load the data for the given map segment.

    Throws

    MapDataLoaderError Specifies reason, why list of data of a segment is not returned.

    Declaration

    Swift

    public func loadData(segment: OCMSegmentId, options: SegmentDataLoaderOptions) throws -> SegmentData

    Parameters

    segment

    The segment to load.

    options

    Request options

    Return Value

    Requested data of a segment.

  • Synchronously load the data for the given map directed segment.

    Throws

    MapDataLoaderError Specifies reason, why list of data of a segment is not returned.

    Declaration

    Swift

    public func loadDirectedSegmentData(segment: DirectedOCMSegmentId, options: SegmentDataLoaderOptions) throws -> SegmentData

    Parameters

    segment

    The directed segment to load.

    options

    Request options

    Return Value

    Requested data of a segment.

  • Synchronously load the optional image providing guidance of a directed or non directed segment.

    Throws

    MapDataLoaderError Specifies reason, why list of data of a segment is not returned.

    Declaration

    Swift

    public func downloadFile(fileReferences: [FileReference], downloadingOptions: DownloadingFileOptions) throws -> [Data]

    Parameters

    fileReferences

    Provides information for a file reference.

    downloadingOptions

    Provides information regarding downloading configuration.

    Return Value

    Requested data of a segment.