Hi I didn’t get an answer before so second try…
I want to control the POV (heading and pitch ) of multiple street view panoramas so when one panorama is interactively moved up down left right the other panorama moves with it
I can get this to work where interaction with panorama moves panorama2 another using this javascript:
google.maps.event.addListener(panorama, 'pov_changed', function() {
panorama2.setPov({ heading: panorama.getPov().heading + $headingoffset, pitch: panorama.getPov().pitch, zoom: panorama.getPov().zoom });
});
when I add the same code to control panorama via interaction with panorma2 both panoramas fail to be interactive so I assume the code causes a loop
google.maps.event.addListener(panorama2, 'pov_changed', function() {
panorama.setPov({ heading: panorama2.getPov().heading - $headingoffset, pitch: panorama2.getPov().pitch, zoom: panorama2.getPov().zoom });
});
\The $headingoffset value is the degree of difference between to two panoramas
do I have to turn the listener off and on again for the other panorama while I change the POV – if so how
Or can this be done via a DIV mouse event instead
Let’s assume that the mouse must be over the panorama to change the POV, so you may:
create a variable.
When the mouse is over the div , assign the div to the variable.
When pov_changed fires, you now may determine if the pov_changed is a result of a user-action(when the variable is set to the div related to the panorama) or not, and do nothing when not.
Demo: http://jsfiddle.net/doktormolle/Y9947/