MapDisplayDataProvider

public protocol MapDisplayDataProvider

The MapDisplayDataProvider protocol that can be used to add custom data providers. FileOutput - Default logger output - prints logs using Swift.print

Important

This API has to be implemented in a thread-safe way.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Registers interest in a resource.

    Declaration

    Swift

    func registerInterestInResource(
        urlString: String,
        allowsCaching: Bool,
        completion: @escaping (Result<Data, Error>) -> ()
    ) -> MapDisplayDataRequestToken?

    Parameters

    urlString

    The resource URL string.

    allowsCaching

    Specifies whether the resource should be cached for future calls.

    completion

    The completion closure is called after the request response has been processed, and at any time afterward when the resource data is updated.

    Return Value

    The MapDisplayDataRequestToken for successful requests. Otherwise returns nil.

  • Should return true if the provider can handle the URL.

    Declaration

    Swift

    func accepts(urlString: String) -> Bool