Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a streetview included in my web site using google API to load it.

var theloc = new google.maps.LatLng(lat, lon);
var panoramaOptions = {
  addressControl: false,
  position: theloc,
  pov: {
    heading: 0, /* North */
    pitch: -40, /* Look down at angle 40deg */
    zoom: 0
  visible: true
var streetview = new google.maps.StreetViewPanorama(document.getElementById("streetview"),

This works, but I have one issue:

I am interested in loading the view by looking at the position I refer to, but when loading this it always points to north, and the location I specify is not necessarily in view.

If pointing to using URL to open a street view direclty in Google, I can simply omit the heading part of the panorama options parameter (cbp) like this:

'                                         \/ The heading value space                        ',,,,40&cbll=58.9582956492561,5.62897047851361

This causes Google to automatically center the view on showing the position specified in cbll, and I don't need to know what heading to use.

Is it possible to do the same in the javascript API? If I try to omit the heading in the pov object, or initializing heading with null, the street view fails to load. I have also tried to set heading=-1, but that just points always to north. I also tried to not set the pov object at all, but that also always points to north (plus I don't get to set vertical angle 40 degrees down like I want).

share|improve this question
Asked and answered on StackOverflow:… – blah238 Jan 14 '13 at 8:31
up vote 2 down vote accepted

As commented by blah238 this was already answered on Stack Overflow in this question:

Getting the POV for Google StreetView API

So based on this answer, this is possible to do, although not as straight-forward as I hoped it would be...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.