How to "see inside" store using Google Map Api call v3.0

1.5k Views Asked by At

I have been working on a map based search app for a while and now I am looking to add functionality around seeing inside stores.

Some public stores such as:

https://www.google.co.uk/maps/@51.508647,-0.132101,3a,75y,217.99h,72.44t/data=!3m5!1e1!3m3!1s4Z0cuVrIU3IAAAQW_jIaYQ!2e0!3e2

The functionality exists to change the view into street view using this example:

https://developers.google.com/maps/documentation/javascript/examples/streetview-service

How would we use the Google Map API call to change the current map view to a pre-determined "see Inside" hotspot?

1

There are 1 best solutions below

0
On

I managed to find a solution, Here are the resources:

http://jsfiddle.net/edwardgolduk/aWLut/

panoramaService.getPanoramaById('iJ8MuM4GeoL0nmlSLSUqNA', function (res, stat) {
   var loc = res.location.latLng;
   var panoramaOptions = {
       position: loc,
       pov: {
           heading: 270,
           pitch: 0
       },
       visible: true
   };
   var panorama1 = new google.maps.StreetViewPanorama(document.getElementById('pano1'), panoramaOptions);
   document.getElementById('pano1_info').innerHTML = res.location.pano;
   panorama1.setPano(res.location.pano);
   // alert(loc.lat()+','+loc.lng());
   });
   var loc2 = new google.maps.LatLng(51.512272, -0.120981);
   panoramaService.getPanoramaByLocation(
   loc2,
   25,

https://developers.google.com/maps/documentation/javascript/streetview#StreetViewService

You can use LAT and LONG - it will detect the nearest panorama

or you can specify a Panorama ID