raj
raj

Reputation: 7

Google Maps API image

How to get the image when searched address in google maps?

While searching addresses in google search it displays the address, rating and image in the left side. I am using the google map api in my application, it's getting only Address and rating,but not image.

Can you provide your feedback,how to get images by using google maps api.

How to get images from google maps api

Upvotes: 0

Views: 197

Answers (1)

KENdi
KENdi

Reputation: 7771

In the Google Places API, you can use the Place Search and Place Details to get a photos of a specific place.

You can see a photo_reference here that is used to identify the photo when you perform a Photo request.

Now, you can use the Place Photo Requests to get the image of the photoreference that you get.

Here is the sample request.

https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=CnRtAAAATLZNl354RwP_9UKbQ_5Psy40texXePv4oAlgP4qNEkdIrkyse7rPXYGd9D_Uj1rVsQdWT4oRz4QrYAJNpFX7rzqqMlZw2h2E2y5IKMUZ7ouD_SlcHxYq1yL4KbKUv3qtWgTK0A6QbGh87GB3sscrHRIQiG2RrmU_jF4tENr9wGS_YxoUSSDrYjWmrNfeEHSGSc3FyhNLlBU&key=YOUR_API_KEY

Upvotes: 1

Related Questions