Discover

public final class Discover

Undocumented

  • Undocumented

    Declaration

    Swift

    public let apiType: ApiType
  • Basic internal initializer

    Declaration

    Swift

    public convenience init(
        accessToken: String? = nil,
        locationProvider: LocationProvider? = DefaultLocationProvider(),
        apiType: ApiType = .defaultType
    )

    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

    apiType

  • Search for places nearby the specified geographic point.

    Declaration

    Swift

    public func search(
        for item: Discover.Query,
        proximity: CLLocationCoordinate2D,
        options: Options = .init(),
        completion: @escaping (Swift.Result<[Result], Error>) -> Void
    )

    Parameters

    item

    Search item

    proximity

    Geographic point to search nearby.

    options

    Search options

    completion

    Result of the search request, one of error or value.

  • Search for places nearby the specified geographic point.

    Declaration

    Swift

    public func search(
        for item: Discover.Query,
        in region: BoundingBox,
        proximity: CLLocationCoordinate2D? = nil,
        options: Options = .init(),
        completion: @escaping (Swift.Result<[Result], Error>) -> Void
    )

    Parameters

    query

    Search query

    region

    Limit results to only those contained within the supplied bounding box.

    proximity

    Optional geographic point to search nearby.

    options

    Search options

    completion

    Result of the search request, one of error or value.

  • Search for places nearby the specified geographic point.

    Declaration

    Swift

    public func search(
        for item: Discover.Query,
        route: RouteOptions,
        options: Options = .init(),
        completion: @escaping (Swift.Result<[Result], Error>) -> Void
    )

    Parameters

    item

    Search item

    route

    Route to search across (points and deviation options).

    options

    Search options

    completion

    Result of the search request, one of error or value.

  • Undocumented

    See more

    Declaration

    Swift

    public struct Address
  • Undocumented

    See more

    Declaration

    Swift

    public struct Options
  • String representing a category name to be searched for. Use one of the suggested categories listed in the enum extension or search for a given string.

    See more

    Declaration

    Swift

    public struct Query
  • Undocumented

    See more

    Declaration

    Swift

    public struct Result