I need put names of highlights from Picker Place from Google Maps SDK to my own TableView. It should be order by distance from center place. I used framework but I see automaticly generated map with picker places and table below.
CLLocationCoordinate2D center = CLLocationCoordinate2DMake(37.788204, -122.411937);
CLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(center.latitude + 0.001,
center.longitude + 0.001);
CLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(center.latitude - 0.001,
center.longitude - 0.001);
GMSCoordinateBounds *viewport = [[GMSCoordinateBounds alloc] initWithCoordinate:northEast
coordinate:southWest];
GMSPlacePickerConfig *config = [[GMSPlacePickerConfig alloc] initWithViewport:viewport];
_placePicker = [[GMSPlacePicker alloc] initWithConfig:config];
[_placePicker pickPlaceWithCallback:^(GMSPlace *place, NSError *error) {
if (error != nil) {
NSLog(@"Pick Place error %@", [error localizedDescription]);
return;
}
As you've seen,
pickPlaceWithCallback
only returns a single place that the user picked.If you're looking for a list of places that the user is likely at right now, then
currentPlaceWithCallback
will work well for you.However if you need a list of results centered around an arbitrary location, unfortunately the iOS Places API doesn't offer a way to do that.