aadilali
aadilali

Reputation: 21

Google Places Api get Photo Data

I am using google places api to get businesses of specific city. I have list of business and there relevant data, get using place detail api. In place detail api i have a reference string of photo. How I can display the photo by using file_get_contents(). I am using PHP as server side coding.

If you enter following url into browser you can see the image. I don't know how to render the resulting image in webpage.

s.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=CnRoAAAAQiZS7dkiWqMWPMmhidMrAH9CyZ3Q2hMwYENL_dW2h8e3d9euO-LZAIq3cbMPRIFvXzEGWDblLujlfP2g6z54OSngjcQ8zJkVcAAHyDk0zJxFhVXLd6cPO7E-jV2WK6P7LjFo8Uknj-2QSueyVBsSQhIQXLO7JEU-vWdshr3NfqyGWRoUmtUSVOWxSOKq4AzhKyUE_M_wHYI&sensor=false&key=Your_own_Key

Regards

Upvotes: 2

Views: 1431

Answers (1)

Nithin Dev
Nithin Dev

Reputation: 421

Use <img>

<img src="https://maps.googleapis.com/maps/api/place/photo?maxwidth=600&photoreference=CnRoAAAAQiZS7dkiWqMWPMmhidMrAH9CyZ3Q2hMwYENL_dW2h8e3d9euO-LZAIq3cbMPRIFvXzEGWDblLujlfP2g6z54OSngjcQ8zJkVcAAHyDk0zJxFhVXLd6cPO7E-jV2WK6P7LjFo8Uknj-2QSueyVBsSQhIQXLO7JEU-vWdshr3NfqyGWRoUmtUSVOWxSOKq4AzhKyUE_M_wHYI&sensor=true&key=Yourkey" />

Upvotes: 2

Related Questions