Thanks - yes, I tried the following:
Create a latlng point at a specified lat and lng:
var point = new google.maps.LatLng(lat,lng);
Create a maeker at that point:
var marker=new google.maps.Marker({position: point});
Place a marker at that point on the panorama
setMap(panorama)
Set the panorama to that location:
panorama.setPosition(point);
If I then compare the values of panorama.getPosition and
marker.position
alert(lng+" "+panorama.position.lng());
alert(lat+" "+panorama.position.lat());
The values will be identical - the panorama.position.lat() call
returns the ;position I requested, not the position that was actually
used.
Looking at the thread above, it would appear that if I put an event
listener on position.changed and then request panorama.position.xxx,
then I may be able to get the actual position of the panorama and from
thsi calculate the bearing... not sure logically why this should work,
but from the thread responses it seems worth a try. I'll give it a
go :-)
Set a panorama to be at that point
On Jun 1, 9:02 am, Miguel Angel Vilela <
mig...@google.com> wrote:
> Hi,
>
> When you request the nearest panorama to a point, you receive the LatLng of
> the panorama itself (inside it) and have the LatLng for which you requested
> the nearest panorama, then you can use both to calculate the bearing. As of
> now, you need to calculate this by yourself.
>
> You might also be interested in this thread:
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...
>
> Cheers,
> Miguel
>
> On Tue, Jun 1, 2010 at 09:49, dbrb2 <
benjamin.bar...@gmail.com> wrote:
> > Hello,
>
> > I'm not sure whether the accuracy of the streetview system allows for
> > this - a streetview set to a specific lat/lon, as well as a marker on
> > the panorama at the same lat/lon.
>
> > I assume that when I call the streetview.setPosition the nearest
> > available streetview position is returned. Is there any way that I can
> > automatically set the POV of my streetview so that when it loads, it
> > is pointing towards the marker I have placed? Since both the marker
> > and the panorama have been requested using the same lat/lon I can't
> > calculate the bearing myself - unless I can find the actual lat/lon of
> > the panorama position I have ended up at...
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to
> >
google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
google-maps-js-a...@googlegroups.com<
google-maps-js-api-v3%2Bunsu...@googlegroups.com>
> > .