Google Maps API v3 - Display Image capture date in StreetView

1.5k views Asked by At

When you visit maps.google.com there is an information at the right bottom corner saying when the image has been captured: screenshot google maps

However on my site when I use Google Maps API, that information is simply not shown. I cannot find any setting for this either. Does anyone know how to display that information?

EDIT: I don't use google.maps.StreetViewPanorama, but google.maps.Map where the user can switch to StreetView mode.

Thanks!

2

There are 2 answers

1
Martin On BEST ANSWER

I was able to set the options by getting the StreetView object from the map:

this.map = new google.maps.Map(this.divContainer, defaultMapOptions);
this.map.getStreetView().setOptions(defaultStreetViewOptions);
2
duncan On

When you create the Street View, specify the imageDateControl attribute in the options. It's disabled by default; you have to enable it.

Something like:

var panorama = new google.maps.StreetViewPanorama(
  document.getElementById('pano'), {
    position: yourLocation,
    imageDateControl: true
  });

See: