Reputation: 41
I am using Google's Street View Static Image API. It works great, but I am wondering if it is possible to get meta data for the images I am saving, specifically the date. Is there anyway to know the date of the static image?
Thanks, Lee
Upvotes: 4
Views: 1399
Reputation: 806
var panoramaOptions = { position: streetViewLocation, pov: { heading: 0, pitch: 5, zoom: 1 }, visible: true, addressControl: false, imageDateControl:true };
Upvotes: 0
Reputation: 5082
Yes, you can get the image date using the Google Maps Street View Service in JavaScript.
Briefly, you would need to go through the usual setup steps to get Google Maps working on your page, then you would do something akin to:
var sv = new google.maps.StreetViewService();
var berkeley = new google.maps.LatLng(37.869085,-122.254775);
sv.getPanoramaByLocation(berkeley, 50, function(data) {
console.log(data.imageDate);
});
data.imageDate will contain the date in YYYY-MM format.
You can use StreetViewService's both getPanoramaById and getPanoramaByLocation methods to obtain this data. Please see here.
Upvotes: 2