1

I want to create a link that takes me to the address' Google Street View. I found this: How to convert an address into a Google Maps Link (NOT MAP)

The solution for the question above was: http://maps.google.com/?q=1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003

Is there a parameter I can add to the link to make it automatically go to Street View?

I am currently using the arcgis World Geocoder in my application, so I will try to pass the address entered into the link to google Street View.

    function locate() {
      map.graphics.clear();
      var address = {
        "SingleLine": dom.byId("address").value
      };
      locator.outSpatialReference = map.spatialReference;
      var options = {
        address: address
      }
      locator.addressToLocations(options);
    }

Thank you!

Community
  • 1
  • 1
Andrew
  • 395
  • 1
  • 5
  • 18

1 Answers1

1

It can be done

here is an example form google docs

 var fenway = new google.maps.LatLng(42.345573,-71.098326);
var mapOptions = {
  center: fenway,
  zoom: 14
};
var map = new google.maps.Map(
    document.getElementById("map-canvas"), mapOptions);
var panoramaOptions = {
  position: fenway,
  pov: {
    heading: 34,
    pitch: 10
  }
};
var panorama = new  google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);
map.setStreetView(panorama);

here is the result

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
  • see https://developers.google.com/maps/documentation/javascript/streetview?hl=FR – Rachel Gallen Jun 13 '14 at 18:40
  • Thanks I'll take a look at this. I am actually using the ArcGIS API for Javascript for my main map. I just want to provide a link to Google Maps Street View for the address that would take me out of my application. – Andrew Jun 13 '14 at 18:54
  • Sure no problem. I was really looking for an alternative to embedding a streetview map into my webpage. Google's TOS will not allow us to use Street View because my content is behind a password protected page (not publicly available). That's why I was looking into some kind of URL that I could attach parameters to in order to go to streetview. – Andrew Jun 13 '14 at 19:01
  • aha. ah well. does the last line of that code not work? – Rachel Gallen Jun 13 '14 at 19:02
  • 1
    i just found this http://stackoverflow.com/questions/387942/google-street-view-url looks useful! – Rachel Gallen Jun 13 '14 at 19:11