GMSPlace - can I get this from a set of coordinates

977 views Asked by At

I have coordinates from a user tapping the map on the screen. Can I get the GMSPlace from the Google API by using the coordinates. Couldn't find anything in the documents or online that helped.

Thanks

1

There are 1 answers

0
Charles Yao On

If you tap on a place, you can also get the place id, then use the place id to create a GMSPlace instance like this:

GMSPlacesClient *placeClient = [GMSPlacesClient sharedClient];
[placeClient lookUpPlaceID:placeID callback:^(GMSPlace * _Nullable result, NSError * _Nullable error) {
    if(!error) {
        [self updatePlace:result];
    }else {
        NSLog(@"Error : %@",error.localizedDescription);
    }
}];