Map Location names in drop down list

旧巷老猫 提交于 2019-12-18 12:42:30

问题


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


回答1:


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

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

For Search results you can use Google Place Autocomplete api.

You can Use this GooglePlacesAutocomplete Example.

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


来源:https://stackoverflow.com/questions/20141391/map-location-names-in-drop-down-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!