Domanda

Is it possible to take advantage of Apple's places information or even reference one using MapKit?

Didn't find anything on Location Awareness Programming Guide. Tried matching the address details using a MKPlacemark, e.g.

    MKPlacemark* placeMark = [[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:@{
                                           (NSString *)kABPersonAddressStreetKey:@"113 Buccleuch Street",
                                             (NSString *)kABPersonAddressCityKey:@"Edinburgh",
                                            (NSString *)kABPersonAddressStateKey:@"UK",
                                              (NSString *)kABPersonAddressZIPKey:@"EH8 9",
                                          (NSString *)kABPersonAddressCountryKey:@"United Kingdom",
                                      (NSString *)kABPersonAddressCountryCodeKey:@"GB",
                              }];


    MKMapItem* mapItem =  [[MKMapItem alloc] initWithPlacemark:placeMark];
    mapItem.name = @"Coyaba";

But it seems like lat/long take precedence over address.

È stato utile?

Soluzione

I think the new (iOS 6.1+) MKLocalSearch is the best fit for what you want. It will find points of interest using a natural language search pattern.

I don't think there's any way to just request all points of interest or retrieve the "clickable objects" like in the Apple Maps app. Many of the objects come from Yelp, so you could look into whether they offer an API.

Altri suggerimenti

Have you tried geocoding example? Download it and try it..

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top