mklocalsearch

MKLocalSearch doesn't provide the same results as search in native Apple Maps app

隐身守侯 提交于 2019-12-03 15:34:41
When I search in MKLocalSearch and Apple Maps using the same string I get different results, usually in Apple Maps I get a lot of different locations but in MKLocalSearch I get only one. Apple Maps: My app using MKLocalSearch: In both cases I was searching being in Berlin and in MKLocalSearchRequest I set .region property of Berlin region Which services does Apple use for their location search? After doing some searching I've investigated that MKLocalSearchCompleter is the class that Apple uses in their Map app. 来源: https://stackoverflow.com/questions/43249382/mklocalsearch-doesnt-provide-the

How to search for locations using UISearchBar with autocompletion and suggestions?

与世无争的帅哥 提交于 2019-12-03 08:51:26
问题 I am developing an app in which user can search for a point of interests, pick a search result and then the MKMapView will be centered to the result coordinate. My question is how to make autocompletion happen? I have did research on MKLocalSearch and MKLocalSearchRequest , and it seems that is Apple suggested API for location search on iOS6.1+. However I cannot find any examples with autocompletion or suggestions with MKLocalSearch and MKLocalSearchRequest . Is it possible to autocomplete a

Use MKLocalSearch to search for locations on a map

こ雲淡風輕ζ 提交于 2019-12-03 06:18:49
问题 I want to use MKLocalSearch for searching in a Map. This functionality is available in iOS 6.1+. Does anybody know how to use this or can anybody give an example of how to use an MKLocalSearch ? MKLocalSearchResponse documentation 回答1: The API for MKLocalSearch is fairly easy to understand. At its most basic, you alloc-init an MKLocalSearchRequest Set its naturalLanguageQuery to some search term Use the search request to initialize an MKLocalSearch object Tell the local search to start,

Use MKLocalSearch to search for locations on a map

大兔子大兔子 提交于 2019-12-02 20:52:07
I want to use MKLocalSearch for searching in a Map. This functionality is available in iOS 6.1+. Does anybody know how to use this or can anybody give an example of how to use an MKLocalSearch ? MKLocalSearchResponse documentation The API for MKLocalSearch is fairly easy to understand. At its most basic, you alloc-init an MKLocalSearchRequest Set its naturalLanguageQuery to some search term Use the search request to initialize an MKLocalSearch object Tell the local search to start, passing it a completion handler Do something with the array of MKMapItem objects in the response Search for Cafes

MKLocalSearch not finding obvious results

被刻印的时光 ゝ 提交于 2019-11-30 22:51:43
My code is virtually identical to the following example: https://github.com/iamamused/Example-MKLocalSearch.git Here are the important bits: @interface ViewController : UIViewController @property (strong, nonatomic) IBOutlet MKMapView *ibMapView; @end @implementation ViewController { MKLocalSearch *localSearch; MKLocalSearchResponse *results; } - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [localSearch cancel]; MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = searchBar.text; request.region = self.ibMapView.region; localSearch

MKLocalSearch not finding obvious results

余生长醉 提交于 2019-11-30 17:59:26
问题 My code is virtually identical to the following example: https://github.com/iamamused/Example-MKLocalSearch.git Here are the important bits: @interface ViewController : UIViewController @property (strong, nonatomic) IBOutlet MKMapView *ibMapView; @end @implementation ViewController { MKLocalSearch *localSearch; MKLocalSearchResponse *results; } - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [localSearch cancel]; MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc]

Accessing MKLocalSearchResponse item (swift)

丶灬走出姿态 提交于 2019-11-29 17:50:17
When I do println(localSearchResponse) , I get a MapItem object, which includes a ton of details about the location. In this example, its UCSD. Here is the output showing in my log. <MKLocalSearchResponse: 0x1c53d640> { boundingRegion = "<center:+32.87514836, -117.23958822 span:+0.00725621, +0.00825332>"; mapItems = ( "<MKMapItem: 0x1c538090> {\n isCurrentLocation = 0;\n name = \"University of California, San Diego\";\n phoneNumber = \"+18585342230\";\n placemark = \"University of California, San Diego, 9500 Gilman Dr, La Jolla, CA 92093-5004, United States @ <+32.87529400,-117.23961000> +/- 0

iOS app getting throttled from local searches

那年仲夏 提交于 2019-11-28 09:11:38
I am implementing autocomplete (one search per new character added) in an app that searches for addresses, and I keep getting MKErrorDomain error 3 , which is MKErrorLoadingThrottled . This error, according to Apple dev , occurs when The data was not loaded because data throttling is in effect. This error can occur if an app makes frequent requests for data over a short period of time. I know exactly how many requests are being made, one for each new charachter in the search query (just like you would expect autocomplete to work). Sure, I am a fast typer, but being able to hit the limit after

iOS app getting throttled from local searches

我的未来我决定 提交于 2019-11-27 02:42:12
问题 I am implementing autocomplete (one search per new character added) in an app that searches for addresses, and I keep getting MKErrorDomain error 3 , which is MKErrorLoadingThrottled . This error, according to Apple dev, occurs when The data was not loaded because data throttling is in effect. This error can occur if an app makes frequent requests for data over a short period of time. I know exactly how many requests are being made, one for each new charachter in the search query (just like