Thanks, I wasn't aware of the bindTo option at the time. It is very nice now that I know about it.
On Thu, Jun 17, 2010 at 9:15 PM, Marc Ridey <[email protected]> wrote: > Note: If you want two markers to keep the same LatLng position, bind the > position property of one marker to the other such as: > > marker1.bindTo('position', marker2); > > As you drag either marker1 or marker2, the other marker will move too, even > if one is in StreetView and the other in the Map. > > On Tue, Jun 15, 2010 at 5:50 AM, Nathan Raley <[email protected]> wrote: > >> Let me describe my current situation as I stand right now. >> >> I set my Pano to a div called pano via: >> myPano = new >> google.maps.StreetViewPanorama(document.getElementById("pano")); >> map.setStreetView(myPano); >> >> Now it is my understanding after some previous replies that in order to >> have a marker show up on both my map as well as my StreetView Panorama that >> I need to have 2 copies of each marker I want to be displayed on both. This >> is even true if I have my markers stored in an array and am using marker >> manager to show the markers on the normal map and am setting the map on the >> individual marker itself to myPano. >> >> Okay, this is fine, so I've created 2 markers, one for the normal map and >> one for my street view. I am storing the markers in 2 different arrays, 1 >> for the street view and one for my normal markers. >> >> I am wanting to update the markers on the normal map if the markers are >> dragged in my street view pano and vice versa. This is updating them fine; >> however, the old marker position and old marker in the pano is still showing >> up and not being removed. I am adding new markers or changing the location >> of previous ones by storing them in the markerid position in my array. If >> it is updating a positon I simply use my >> Array[markerID].setPosition(position) to the new position. >> >> However, the marker in the Pano is being shown at the new Position but the >> old position and old marker location is not being removed. Is it not >> possible to remove a marker from the StreetViewPanorama? I have tried >> cycling through my street view array and for each marker stored in it doing >> a .setMap(null) and then calling a function once that has completed to >> reload the markers in the array, which have the updated positions, but the >> old marker is still showing up. >> >> Also, another thing to note is I added the following listeners for the >> markers as such: >> StartListeners.push(google.maps.event.addListener(ZoneStartFinishMarkers[idStart], >> "drag", (function(){ // Creates the Listener for the StartMarker >> var Point = ZoneStartFinishMarkers[idStart].getPosition(); // Gets >> the new location of the marker >> ZoneStartFinishMarkersSV[idStart].setPosition[Point]; >> } ))); >> >> Which should be updating the position of the marker in the street view >> panorama if I understand things correctly as the regular map marker is being >> dragged; however, this fails to do so. >> >> Any ideas? >> >> -- >> 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 >> [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-maps-js-api-v3%[email protected]> >> . >> >> For more options, visit this group at >> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >> > > -- > 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 > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-maps-js-api-v3%[email protected]> > . > > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
