On Dec 10, 3:29 am, Keith <[email protected]> wrote: > Thanks Larry, > > This is almost working. I added your suggestion with some success, > however, regardless of which marker I click, #9 always gets set to > draggable. I put the marker click listener inside the for loop of > my AJAX > call to create the markers. #9 is the last marker created > so it is setting activeMarker. I tried moving the click listener > outside the loop and it caused an error 'activeMarker is not > defined'. I moved the click listener back inside the loop in my > example so it wouldn't throw an error:
http://www.austintreeexperts.com/AJAXmap-tester.php?f=http%3a%2f%2fww... None of your "links" work out of the box for me. I have a proof of concept page that I made what I suggested in my last post work to first order. The problem with my implementation is that once you click on a marker it gets set to draggable and stays that way. I will post it when I get a chance, but it might be a while. -- Larry > > On Dec 9, 6:42 pm, "[email protected]" <[email protected]> > wrote: > > > > > > > > > On Dec 9, 4:29 pm, "[email protected]" <[email protected]> > > wrote: > > > > On Dec 9, 3:51 pm, Keith Brown <[email protected]> wrote: > > > > > Tried marker.setDraggable(true) and doesn't work. Firebug console says > > > > marker is not defined? > > > > I don't see marker defined in the global scope. I see lots of > > > "marker" variables local to various (other) functions, but not that > > > would be defined in this click listener > > > > google.maps.event.addDomListener(moveTreeOuter, 'click', > > > function() { > > > marker.setDraggable(true)}); > > > > How are you expecting it to know which tree to move? (what the value > > > of "marker" should be?) > > > One suggestion: > > 0. create a global variable "activeMarker" > > 1. add to the marker click listener: activeMarker = marker > > 2. change the "move tree" click listener function to > > activeMarker.setDraggable(true); > > > Then if the user clicks on a marker, the infowindow opens. They can > > click on "move tree" and drag it. > > > -- Larry > > > > > Moved the example > > > > here:http://www.austintreeexperts.com/AJAXmap.php?f=http%3a%2f%2fwww.austi...quoted > > > > text - > > > > - Show quoted text - -- 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.
