0

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?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sunil Chauhan
  • 2,074
  • 1
  • 15
  • 33

2 Answers2

1

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

janineanne
  • 585
  • 7
  • 17
  • So how do you get the image url for a Google place? `loadPlacePhoto` only returns `UIImage`s . – Cesare Feb 06 '18 at 12:29
0

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.

Sunil Chauhan
  • 2,074
  • 1
  • 15
  • 33