I have a google v3 map with streetview pegman control.
The map also contains a marker, which is periodically moved.
I wanted to be able to see this marker when I was in streetview mode, so I created a panorama:
I created a panorama:
var panoramaOptions = {
addressControl: false,
enableCloseButton: true,
pov: {
heading: 90,
pitch: 0,
zoom: 0
}
};
panorama = new google.maps.StreetViewPanorama(document.getElementById("map_canvas"),panoramaOptions);
(note the panorama is in the map_canvas div - the same div used for the map)
I hope then that, if I enabled the panorama (by dragging the pegman onto the map), if I panned to the correct location I would see any markers that I had placed on that map using the:
marker2.setPosition(latlng);
where latlng is a position, and marker2 was created with:
marker2 = new google.maps.Marker({
position: latlng,
cursor: "
http://maps.google.com/mapfiles/openhand.cur",
icon: "marker.png",
map: panorama
});
But instead, though streetview loads, I see no markers.
Am I doing something obviously wrong?
Cheers,
Ben