use autocomplete feature of mapbox in ios application

为君一笑 提交于 2019-12-11 12:04:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!