Picker Places from Google Maps to UITableView

我的梦境 提交于 2020-01-15 06:08:40

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/31657813/picker-places-from-google-maps-to-uitableview

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