在下拉列表中映射位置名称 [英] Map Location names in drop down list

查看:117
本文介绍了在下拉列表中映射位置名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序必须使用文本框集成搜索位置名称。 Map kit是否有任何方法来实现这种功能?下图显示我确切需要的内容

My App Has to integrate search location names using text box. Is Map kit has any method to implement this kind of a functionality ? This below image displays what i exactly need

推荐答案

没有,MapKit没有任何方法来实现这种类型的属性..

No , there is not any method of MapKit to implement this type of property..

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

For That You have to implement Your own Code, i.e. use of UISearchbarCantroller or Simple UISearchbar.

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

For Search results you can use Google Place Autocomplete api.

您可以使用此 GooglePlacesAutocomplete示例


iOS> = 6.1中提供 MKLocalSearch ,< a href =https://github.com/spoletto/SPGooglePlacesAutocomplete =nofollow> MKLocalSearchRequest 搜索自然语言兴趣点。样本

In iOS >= 6.1 provides MKLocalSearch, MKLocalSearchRequest to search for natural language points of interest. Sample

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

这篇关于在下拉列表中映射位置名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆