OnlineReverseGeocoderFactory

public enum OnlineReverseGeocoderFactory

Creates an implementation of the Reverse Geocoding API based on TomTom’s online service. Reverse geocoding is the process of translating geographic coordinates in the form of latitude and longitude into a readable address or location description that can be easily understood by humans. This process makes possible the identification of specific location details such as the street address, city, postal code, and other relevant information associated with a particular location on a map. For example, the location (52.391174, 4.910375) can be translated to the address (Distelweg, 141031 HE, Amsterdam). A typical use case is for the end user to click on the map and see the address at the clicked position.

  • Contains default values for online ReverseGeocoder creation.

    See more

    Declaration

    Swift

    public enum Defaults
  • Errors that might happen for online ReverseGeocoder.

    See more

    Declaration

    Swift

    public enum OnlineReverseGeocoderError : Error
  • Creates a new ReverseGeocoder instance to perform online reverse geocoding requests.

    Declaration

    Swift

    public static func create(
        apiKey: String,
        customAPIURL: URL = Defaults.apiURL,
        geopoliticalView: String? = nil
    ) throws
        -> ReverseGeocoder

    Parameters

    apiKey

    A valid TomTom API Key.

    customAPIURL

    Custom base URL for online APIs. Defaults to Defaults.apiURL consequently. Can be used to change to another service that implements the same API.

    geopoliticalView

    The country code in the ISO 3166-1 alpha-2 format whose view on disputed areas should be used. If not provided, or not supported, the international geopolitical view will be used.

    Return Value

    A new ReverseGeocoder instance to perform online reverse geocoding requests.