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%2fwww.austintreeexperts.com%2fgmapsXML.cfm%3fu%3d558%26ad%3d23719

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...Hide
> > >  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.

Reply via email to