问题
Can we use autocomplete feature of Mapbox into iOS application ?
I'm looking for some kind of help for that.
I have already created a map view using Mapbox. But now I want to add a textfield onto it and when i look for a place, the autocomplete feature should populate some place names for me.
回答1:
Have a look at MapboxGeocoder.swift and UISearchBar.
回答2:
autocompletesQuery is enabled by default, you can change it with options.autocompletesQuery = BOOL then get the results array of suggestions like
let task = geocoder.geocode(options: options) { (placemarks, attribution, error) in
print(placemarks)
}
来源:https://stackoverflow.com/questions/33780219/use-autocomplete-feature-of-mapbox-in-ios-application