【问题标题】:Map Location names in drop down list下拉列表中的地图位置名称
【发布时间】:2013-11-22 09:32:51
【问题描述】:

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

【问题讨论】:

    标签: ios mapkit


    【解决方案1】:

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

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

    对于搜索结果,您可以使用Google Place Autocomplete api。

    你可以使用这个GooglePlacesAutocomplete Example

    在 iOS >= 6.1 提供MKLocalSearchMKLocalSearchRequest 来搜索自然语言兴趣点。样本

    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
    }];
    

    【讨论】:

      猜你喜欢
      • 2021-09-30
      • 2018-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-18
      • 2015-05-21
      相关资源
      最近更新 更多