OGeek|极客世界-中国程序员成长平台

标题: ios - 下拉列表中的 map 位置名称 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 05:32
标题: ios - 下拉列表中的 map 位置名称

我的应用程序必须使用文本框集成搜索位置名称。 map 套件有什么方法可以实现这种功能吗?下图显示了我到底需要什么

enter image description here



Best Answer-推荐答案


没有,MapKit没有任何方法可以实现这种属性..

为此,您必须实现自己的代码,即使用 UISearchbarCantroller 或 Simple UISearchbar。

对于搜索结果,您可以使用 Google Place Autocomplete接口(interface)。

您可以使用 GooglePlacesAutocomplete Example .

在 iOS >= 6.1 提供 MKLocalSearch , MKLocalSearchRequest搜索自然语言兴趣点。样本

MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
request.region = regionToSearchIn;
request.naturalLanguageQuery = @"restaurants"; // or business name
MKLocalSearch *localSearch = [[MKLocalSearch alloc] initWithRequest:request];
[localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
    // do something with the results / error
}];

关于ios - 下拉列表中的 map 位置名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20141391/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4