问题描述
无论我给地理编码器提供什么地址([geocoder geocodeAddressString:completionHandler:],它始终只会在地标数组中放置一个对象。
Whatever address i give to the geocoder ([geocoder geocodeAddressString:completionHandler:), it always puts only one object in the placemarks array.
我可以通过任何方式获得多个结果(例如在地图应用中),用户可以从中选择一个?
I there any way to get multiple results (like in Maps app) from which the user can select one?
推荐答案
我已经对数据包进行了一些嗅探,看来CLGeocoder没有连接到Google的地理编码服务,但是苹果。我还注意到,每次都从那里仅获得一个地标。
I've done some sniffing on the packets and it seems that CLGeocoder doesn't connect to Google's geocoding service, but to Apple's. I've also noticed that I get only one placemark from there every time.
如果您想要更复杂的内容,则应使用Google或其他地理编码。我使用,该API具有非常相似的API到CLGeocoder。
If you want something more sophisticated you should use Google's or other geocoding. I use SVGeocoder (https://github.com/samvermette/SVGeocoder), which has a very similar API to CLGeocoder.
这篇关于如何从CLGeocoder获取多个地标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!