user2170535
user2170535

Reputation: 41

date of street view static image

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

Answers (2)

blomster
blomster

Reputation: 806

var panoramaOptions = { position: streetViewLocation, pov: { heading: 0, pitch: 5, zoom: 1 }, visible: true, addressControl: false, imageDateControl:true };

Upvotes: 0

Greg Sadetsky
Greg Sadetsky

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

Related Questions