PlaceAutocomplete

public final class PlaceAutocomplete

Main entrypoint to the Mapbox Place Autocomplete SDK.

  • Basic internal initializer

    Declaration

    Swift

    public convenience init(
        accessToken: String? = nil,
        locationProvider: LocationProvider? = DefaultLocationProvider()
    )

    Parameters

    accessToken

    Mapbox Access Token to be used. Info.plist value for key MGLMapboxAccessToken will be used for nil argument

    locationProvider

    Provider configuration of LocationProvider that would grant location data by default

  • Undocumented

    See more

    Declaration

    Swift

    struct Options
  • Values to filter Place Autocomplete results to include only a subset (one or more) of the available feature types.

    See more

    Declaration

    Swift

    enum PlaceType : Equatable
  • Undocumented

    See more

    Declaration

    Swift

    struct Result
  • Undocumented

    See more

    Declaration

    Swift

    struct Suggestion
  • Start searching for query with provided options

    Declaration

    Swift

    func suggestions(
        for query: String,
        region: BoundingBox? = nil,
        proximity: CLLocationCoordinate2D? = nil,
        filterBy options: Options = .init(),
        completion: @escaping (Swift.Result<[Suggestion], Error>) -> Void
    )

    Parameters

    query

    text query for suggestions

    proximity

    proximity Optional geographic point that bias the response to favor results that are closer to this location.

    options

    Search options used for filtration

  • Start searching for query with provided options

    Declaration

    Swift

    func suggestions(
        for query: CLLocationCoordinate2D,
        filterBy options: Options = .init(),
        completion: @escaping (Swift.Result<[Suggestion], Error>) -> Void
    )

    Parameters

    coordinate

    coordinates query

    options

    Search options used for filtration