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

1

7

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

Neoteric answered 24/2, 2015 at 20:25 Comment(1)
As stated in a previous comment I don't think this is available right now.Bouleversement
T
3

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.

Tenderhearted answered 6/5, 2016 at 12:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.