Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API to display the nearest photos to a long/lat location from Google Maps Views (like Panoramio)

Forgive me if this has already been asked but searching on 'Google Maps Views' brings up rather a lot of irrelevant hits.

Is there an API to display the nearest (say) 5 photos to a particular long/lat location from the photos available on Google Maps Views? I don't particularly need them on a map, just to embed thumbnails of the photos and link to the originals.

eg I have a page for Callanish stone circle. Could I embed images from Views based on a long/lat query?

Here's what is on Views for that location: https://www.google.com/maps/views/explore?hl=en&gl=gb&vm=1&ll=54.596562,-3.104517&bd=54.586641,-3.121855,54.606481,-3.087179&z=15&pv=2

I read that Views is what is supposed to be taking over from Panoramio. I know Panoramio had an API but that's being shut down.

If this is possible, does anyone have an example of something similar? Showing photos on a map would be OK if that's the only way to do it. Many thanks Andy http://www.megalithic.co.uk/article.php?sid=42

like image 584
Megalithic Avatar asked Feb 24 '15 20:02

Megalithic


People also ask

Is Google Maps API free?

All Maps Embed API requests are available at no charge with unlimited usage.


1 Answers

The Google Maps API can do it and the imagery carousel at the bottom of Google Maps website is a good example of it.

Nearest photos

You can retrieve the nearest photos to a location using the Places Photo feature, which is part of the Places library. As you want multiple photos, you need to use Place Details requests - function getDetails(). It will return up to ten PlacePhoto objects.

You probably want to submit a small height/width since you create thumbnails. And send another request with a larger height/width when a thumbnail is clicked.

Nearest Street View panorama

If, by chance, a road close to Callanish stone circle has been photographed by Street View, you can add this imagery as well.

Requests for Street View panoramas include a radius parameter. The callback function returns the nearest imagery within the requested radius. See this example. Thereby, you can retrieve one panorama by passing a very large radius.

like image 96
agaudin Avatar answered Sep 30 '22 21:09

agaudin