Google Maps Api V3 - Assigning Multipe Listeners to Same Marker Object

89 views
Skip to first unread message

Digital Precision

unread,
Dec 6, 2011, 5:47:37 PM12/6/11
to Google Maps JavaScript API v3
I posted a question on stackoverflow.com (http://stackoverflow.com/
questions/8394278/google-maps-api-v3-assigning-multiple-listeners-to-
same-marker-object), but haven't received any responses yet, so I
figured I'd try the google groups for v3.

In v2 we were able to assign multiple events to the same marker which
allowed us to pop-up an info window when a user did any of these
events; mouseover, mouseout, click. However in v3 I am getting odd
behavior when I attempt the same thing. For example, when I mouseover,
it appears that the mouseout event is fired, then the mouseover event.
This is a problem because then the info window quickly renders then
disappears.

Is this a known limitation of v3? If so, when can we expect the
ability to support multiple listeners for a single marker?

Thanks in advance.

Digital Precision

unread,
Dec 6, 2011, 6:54:42 PM12/6/11
to Google Maps JavaScript API v3
This appears to only be happening in Firefox, Chrome handles the
listeners as expected.

On Dec 6, 2:47 pm, Digital Precision <digitalprecis...@gmail.com>
wrote:

waldo22

unread,
Dec 6, 2011, 7:14:38 PM12/6/11
to google-map...@googlegroups.com
This works OK for me in all browsers.

I added the "mouseover" event before "mouseout".

Here's a page with all kinds of stuff going on.

https://www.scratchtakeout.com/cgi-bin/manageZones.pl

Sorry I can't be of more help...

-Wes

Digital Precision

unread,
Dec 6, 2011, 8:25:37 PM12/6/11
to Google Maps JavaScript API v3
The listeners with alerts worked in all browsers? It's still happening
for me in non-chrome browsers.

The link you posted is assigning event listeners to a polygon object,
not a marker object.

Thanks though.

Rossko

unread,
Dec 7, 2011, 4:28:09 AM12/7/11
to Google Maps JavaScript API v3
> The link you posted is assigning event listeners to a polygon object,
> not a marker object.

How about a link to your problem page, it would save everyone wasting
time guessing what you mean.

MymsMan

unread,
Dec 7, 2011, 4:32:43 AM12/7/11
to google-map...@googlegroups.com
What version of Chrome are you using?
There was a version of chrome a few weeks back that introduced a whole raft of problems with google maps but a subsequent refresh resolved them. 
Try updating Chrome, if that doesn't help post a link to a map exhibiting the problem.

Digital Precision

unread,
Dec 7, 2011, 4:28:09 PM12/7/11
to Google Maps JavaScript API v3
Sorry all, I should have included code in my original post, didn't
mean to waste anyone's time.

I have gone ahead and setup 2 map demos so a side-by-side comparison
can be done.

Version 2 Url: http://map.ownij.com/index2.php

Version 3 Url: http://map.ownij.com/

Version 2 even listener behavior in Firefox, IE, Chrome:
mouseover: mouseover
click: click
mouseout: mouseout

Version 3 event listener behavior in Firefox, IE:
mouseover: mouseout, mouseover, mouseover
click: click, mouseout, click
mouseout: mouseout, mouseout

Version 3 even listener behavior in Chrome:
mouseover: mouseover
click: click
mouseout: mouseout

As you can see, v3 event behavior works as expected in chrome, but in
FF and IE, each event triggers multiple listeners which results in
unusual behavior. We built our maps to allow a map bubble to appear
when a user hovers over a marker, so when the mouseover fires the
mouseout event, the bubble re-renders indefinitely until the user
moves the mouse off the marker.

We cannot release our v3 upgrade until this has been resolved,
otherwise we rob our clients of current functionality.

Thanks in advance.

Digital Precision

unread,
Dec 7, 2011, 4:58:23 PM12/7/11
to Google Maps JavaScript API v3
I changed the alerts to console.log() and listeners work as expected,
it appears the extra events being fired in FF and IE have something to
do with non-infowindow (ebubble, alert) renderings.

On Dec 7, 1:28 pm, Digital Precision <digitalprecis...@gmail.com>
wrote:

Reply all
Reply to author
Forward
0 new messages