Upon further investigation, I realize the problem is caused by closing
the infowindow in the click handler without stopping the propagation
of the event.  Because you close the infowindow, the event goes
directly to the map instead of passing through the infowindow which
blocks the map from handling it.

So, if you are determined to call infowindow.close() in the onclick
handler, you'll need to first stop the propagation of the DOM event.
I did this by changing your onclick handlers from
onclick='do_thing_3();return false;' to onclick='do_thing_3', which
will pass the event as the first argument.  You can then call
stopPropagation on the event (and set returnValue = false; for IE).

You can read more about event propagation here: 
http://www.quirksmode.org/js/events_order.html

Hope this helps!
Susannah

On Jul 23, 9:36 am, "Susannah (Google Employee)"
<susann...@google.com> wrote:
> I have confirmed the error.  We'll have it fixed soon.
>
> Thanks for reporting it!
> Susannah
>
> On Jul 23, 6:53 am, Joseph Elfelt <josephelf...@gmail.com> wrote:
>
> > New map 
> > version:http://www.mappingsupport.com/forum_post/drag_marker_and_line_beta2.html
>
> > Recap:  My problem involves a global infowindow that displays a menu.
> > The info window uses an  onclick command to execute different
> > functions.
> > When the user clicks a menu item in the info window that also causes a
> > map click to go into the queue.
>
> > Goal:  Find code I can include in the functions that (1) will close
> > the info window (2)  without a click  being fired on the map.
> > An unwanted map click is a Bad Thing since it causes an additional
> > marker to appear and the line to be extended to that marker.
>
> > The marker context menu for the above map has 5 menu items functions
> > and each executes a different function with different code.
> > None of them accomplish my goal.
> > Either the infowindow is not closed (1, 2 & 5) or the infowindow is
> > closed but an additional marker is dropped on the map (3  & 4).
>
> > Note that the code for menu item #2 is:
> >         google.maps.event.trigger(masu.infowindow, "closeclick");
> > To my surprise, this did not close the infowindow.
> > Hopefully I did not mess up this simple syntax.
>
> > Another item to note.
> > If a menu item is clicked and eventually the user closes the
> > infowindow by clicking the 'x', then  an additional marker  is _not_
> > dropped on the map.
> > But, if a menu item is clicked and the infowindow is closed with code,
> > then an additional marker _is_ dropped on the map.
>
> > Any suggestion for how I can achieve my goal?

-- 
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-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to