mklocalsearch

Create a title for annotation from MKLocalSearch

北城以北 提交于 2020-01-03 03:28:04
问题 I have added an MKLocalSearch and the pins are displaying correctly. The only problem is that the pins titles have both the name and address, were I only want the name. How would I change this. Here is the code I am using - - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = @"School"; request.region = mapView.region; MKLocalSearch *localSearch = [[MKLocalSearch alloc]

Accessing MKLocalSearchResponse item (swift)

只谈情不闲聊 提交于 2019-12-29 09:58:05
问题 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,

Batch Geocode MKLocalSearchResponse

孤人 提交于 2019-12-24 01:33:06
问题 I have a search setup that displays the response of a MKLocalSearchRequest in UITableVIew I want to clean up all the responses from the response of each search. Here is my shot at accomplishing this so far, inspired by this post Multiple Locations on Map (using MKMapItem and CLGeocoder) Here is my code. @interface ViewController () <UISearchBarDelegate,UISearchDisplayDelegate,UITextFieldDelegate> @property (nonatomic, strong) UISearchDisplayController *searchController; @property (nonatomic,

How to use MKLocalSearch In MKMapView

会有一股神秘感。 提交于 2019-12-12 00:15:46
问题 i am using MKLocalSearch in MKMapView..I am implementing as follow extension MYClass: SendLocationDelegate{ func sendCoOrdinates(loccoordinate:CLLocation, placemark:CLPlacemark){ println(" Google VC coordinate is as \(loccoordinate.coordinate.longitude) \(loccoordinate.coordinate.latitude)") let location:CLLocationCoordinate2D = CLLocationCoordinate2D(latitude:loccoordinate.coordinate.latitude, longitude: loccoordinate.coordinate.longitude) let theSpan : MKCoordinateSpan = MKCoordinateSpan

Create a title for annotation from MKLocalSearch

三世轮回 提交于 2019-12-06 15:13:43
I have added an MKLocalSearch and the pins are displaying correctly. The only problem is that the pins titles have both the name and address, were I only want the name. How would I change this. Here is the code I am using - - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = @"School"; request.region = mapView.region; MKLocalSearch *localSearch = [[MKLocalSearch alloc] initWithRequest:request]; [localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response,

MKLocalSearch WITHOUT MKMapView

谁说胖子不能爱 提交于 2019-12-06 07:19:56
问题 I would like to use MKLocalSearch to display results for a pre-defined string with results relevant to the users position, however all the examples I have seen so far require or use MKMapView to set the users location, and perhaps use the search bar to gather the text needed for the search. I would simply like to perform the search on a predefined string and load the results in a tableview, without first having a map, is there a good example of how to do this? Editing to add more detail,

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

倾然丶 夕夏残阳落幕 提交于 2019-12-05 00:38:19
问题 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? 回答1: After doing some searching I've investigated that MKLocalSearchCompleter is the class that