我正在使用 MAPBOX SDK 在我的ForwardGeocodeOptions
示例应用中实施iOS
。我正在打电话来获取地标。但总是只得到10个结果。我希望得到至少30个或更多的结果。我该怎么办?
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()
}
内部调用此API: -