HybridReverseGeocoder

public final class HybridReverseGeocoder : ReverseGeocoder

Implementation of ReverseGeocoder that wraps online and offline reverse geocoders. It orchestrates how the SDK uses the two geocoders to improve the reliability of the reverse geocoding functionality.

Important

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

Lifecycle

  • Creates a hybrid reverse geocoder

    Declaration

    Swift

    public convenience init(
        apiKey: String,
        store: MapDataStore,
        timeout: Measurement<UnitDuration> = .tt.seconds(5),
        customAPIURL: URL? = nil
    ) throws

    Parameters

    apiKey

    API key for the online reverse geocoder.

    store

    onboard map data handle.

    timeout

    the duration after which primary geocoder results are ignored and the fallback geocoder starts handling the query

    customAPIURL

    custom base URL for online APIs.

Public

  • Reverse Geocoding API gives users a tool to translate a coordinate (for example: 37.786505, -122.3862) into a human-understandable street address, street element, or geography.

    Declaration

    Swift

    public func reverseGeocode(
        options: ReverseGeocoderOptions,
        completion: @escaping (Result<ReverseGeocoderResponse, Error>) -> ()
    )

    Parameters

    options

    The ReverseGeocoderOptions

    completion

    Parameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred, ReverseGeocoderResponse contains an array of categories and subcategories together with their translations and synonyms.