0
votes

I am implementing ForwardGeocodeOptions in my iOS sample app using MAPBOX SDK. And I am making a call for getting Placemarks. But always getting 10 results only. I want to get minimum 30 results or more than that. How can I get ?

func getResults(){

    let options = ForwardGeocodeOptions(query: "restaurant")
   // options.allowedISOCountryCodes = ["IN"]
    options.focalLocation = CLLocation(latitude: 17.4447496, longitude: 78.3136091)
    options.allowedScopes = [.pointOfInterest,.all]
    options.maximumResultCount = 50
    let task = Geocoder.shared.geocode(options) {(placemarks, attribution, error) in
        if let error = error {
            NSLog("%@", error)
        } else if let placemarks = placemarks, !placemarks.isEmpty {
             print(" \(placemarks.count)")               

        }
    }
    task.resume()
}

Internally calling this API :-

1

1 Answers

0
votes

Per the API docs, 10 is the upper limit for a forward geocoding request. You’re free to make multiple requests with different parameters.