I\'m working in a project where I need to show google map street view heading towards road.
I\'ve set the heading: 0 for the panorama object. But for different locat
Finally I found a very easy solution..
For the street view there's two links to navigate, that point towards street. I just read those heading and set the street view POV towards that direction. Here's full code.
var panoramaOptions = {
position: langlongObj,
visible: true
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById("map_canvas"), panoramaOptions);
map.setStreetView(panorama);
google.maps.event.addListener(panorama, 'links_changed', function() {
var links = panorama.getLinks();
panorama.setPov({
heading: links[0].heading,
pitch: 0,
zoom: 1
});
});