Get image url from GMSPlace

910 Views Asked by At

Is there any ways I can get image url from GMSPlace object? For example, if the GMSPlace represents a restaurant, then is there any way I can get that restaurant's image via google api? Or any other service from google?

2

There are 2 best solutions below

1
On BEST ANSWER

This is now possible; see here:

https://developers.google.com/places/ios-api/photos

There are other versions of loadPlacePhoto with more arguments than are shown there if you need them:

https://developers.google.com/places/ios-api/reference/interface_g_m_s_places_client

0
On

Well, for all fellows behind me with this question, answer is NO, you cannot. I used web-service from google, which returns photo_reference parameter in photos object, which can be used to fetch the photo of the restaurant image.

Example: https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference= CmRdAAAA-YL_I_Gk02blOX6S0nKHry8PFu9pDyp3Y9AnqISsa3Eq8mkbdD5mXuu1Fax60s0nSy3iiX-h5j-ztyLHcc1-782MsLQsgLLa4t3ZgDmCMll-a8ABapZGnZwDKByk67LFEhBgedv_u_eYFsEo9ay8jxJjGhTUHKPJ4G82vBJqSNliuv7UlAtclw&&key=YOUR_SERVER_KEY

Update: Recently google did provide a way to do so, as mentioned in above answer.