搜索Apple Maps iOS 10

时间:2016-10-13 15:42:57

标签: ios mapkit mklocalsearch

我正在尝试从MKLocalSearch重新创建/获取相同的搜索列表,但没有运气。我尝试了很多区域,半径,三角形的选项。但我的结果与Apple Maps应用程序的结果不同。对于搜索地点的所有想法,苹果地图的结果更好。

我在Apple文档中使用了MapSearch app

和选项

MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = searchString; 
request.region = MKCoordinateRegionMakeWithDistance(CLLocationCoordinate2DMake(self.userCoordinate.latitude, self.userCoordinate.longitude), 100, 100);

它是一个很大的不同

enter image description here enter image description here

更新

我注意到当我输出更精确的查询时,结果是一样的(如果我把地名全名),但我不知道如何找到更多结果使用一个字母,如示例

1 个答案:

答案 0 :(得分:1)

您可能想尝试使用MKLocalSearchCompleter API。这是文档链接。 https://developer.apple.com/reference/mapkit/mklocalsearchcompleter

相关问题