Infobox displays on top of other markers, but passes through events to underlying markers

1,418 views
Skip to first unread message

RobRoyAus

unread,
Aug 22, 2011, 10:40:01 AM8/22/11
to Google Maps JavaScript API v3
Hi all,

I'm using the InfoBox (this version
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/)
with the InfoBox for each marker popping up on mouse-over.

My test page is here: http://dev-default.wales.info/town-new.asp?propertytown=cardiff
(with opacity of the InfoBoxes set so you can see underlying markers)

When you mouseover a marker the correct InfoBox pops up and links in
the InfoBox are clickable. However, when the open InfoBox overlaps
another marker and you move the cursor across the open InfoBox and
over the underlying marker, the mouseover event of the underlying
marker fires and its InfoBox opens. The desired behaviour is that an
open InfoBox should sit on top of everything and mask events for any
hidden markers until it is closed.

Isn't this supposed to be handled by the "enableEventPropagation"
property of the InfoBox options? I have it set to false.

Thanks for your help
Rob

Gary Little

unread,
Aug 24, 2011, 1:35:27 AM8/24/11
to Google Maps JavaScript API v3
I see the problem. I've tried to create a simple test case to
reproduce it using one of the InfoBox examples but it works correctly.

Could you create a minimal test case to illustrate the problem?
There's something odd here that I can't quite put my finger on.

Gary

On Aug 22, 7:40 am, RobRoyAus <robroy...@gmail.com> wrote:
> Hi all,
>
> I'm using the InfoBox (this versionhttp://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobo...)

Noli Sicad

unread,
Aug 24, 2011, 1:53:37 AM8/24/11
to google-map...@googlegroups.com
Do you have simple example illustrating how to use this infobox?

Thanks.

Noli

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

Gary Little

unread,
Aug 24, 2011, 10:55:56 AM8/24/11
to Google Maps JavaScript API v3
Rob,

OK, I've now figured this out. It turns out the problem occurs when
using markers that have the optimized property set to true -- and with
current versions of Google Maps API the default setting is true. In
this situation Google uses a canvas to render markers and it seems
this is interfering with event capturing.

It turns out the problem occurs not only with InfoBox but also with
google.maps.InfoWindow.

The workaround is to set the optimized property to false when creating
your markers.

I'm going to file a bug report against google.maps.InfoWindow --
hopefully the same fix can be applied to InfoBox.

Gary

On Aug 22, 7:40 am, RobRoyAus <robroy...@gmail.com> wrote:
> Hi all,
>
> I'm using the InfoBox (this versionhttp://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobo...)

Gary Little

unread,
Aug 24, 2011, 11:22:01 AM8/24/11
to Google Maps JavaScript API v3

Pil

unread,
Aug 24, 2011, 12:22:00 PM8/24/11
to Google Maps JavaScript API v3
Very good debugging work, Gary.

I've also played around with the example and came to a rather more
dirty workaround. When you set a global boolean - let's call it
'opened' - to true as long as an infowindow is open you can avoid
firing a new mouseover event until 'opened' is set to false.

But both your workaround and my dirty workaround aren't able to
prevent that the mouse cursor will change to the 'pointer' cursor when
hovering over a marker icon underneath the opened infobox (in the
original example).

I'd guess is that this is caused by the huge library[1] 'handlebars.
1.0.0.beta.3.js' which is - in my eyes - absolutely redundant.


[1] Because this doesn't happen in the bug report example

http://www.luxcentral.com/bug/infowindow-bug.html

even when applying a workaround.

Gary Little

unread,
Aug 24, 2011, 12:58:10 PM8/24/11
to Google Maps JavaScript API v3
Pil,

The cursor change issue seems to be unique to InfoBox -- it doesn't
happen when using google.maps.InfoWindow. Not sure what trick Google
has used to prevent the cursor change, but I'd like to find out!

I can see how your workaround solves the problem as well. But if
you're not dealing with a large number of markers (where speed is
important) setting optimized to false is certainly the easiest
workaround.

Gary

Gary Little

unread,
Aug 24, 2011, 10:02:48 PM8/24/11
to Google Maps JavaScript API v3
The cursor change issue has now been fixed in the trunk version
(1.1.8) of InfoBox that I posted earlier today:

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js

Noli Sicad

unread,
Aug 24, 2011, 10:12:17 PM8/24/11
to google-map...@googlegroups.com
On 8/24/11, Noli Sicad wrote:
> Do you have simple example illustrating how to use this infobox?
>
> Thanks.
>
> Noli

No one like to answer my question :-)

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/examples.html

Gary Little

unread,
Aug 24, 2011, 10:39:44 PM8/24/11
to Google Maps JavaScript API v3

RobRoyAus

unread,
Aug 25, 2011, 6:42:55 AM8/25/11
to Google Maps JavaScript API v3

Thanks everyone. The new version of the InfoBox library works as
required and I'm off and running again.

Regards
Rob

John Lauck

unread,
Mar 16, 2012, 4:37:08 PM3/16/12
to google-map...@googlegroups.com
Does anyone have an example of this working, without changing the Marker(optimized: true) ? 

I'm using Google Maps 3 (nightly) and the Infobox 1.1.11 and still experience the hover issue for markers underneath the InfoBox.

Oleg Loginov

unread,
Apr 28, 2016, 7:52:36 PM4/28/16
to Google Maps JavaScript API v3
Version 1.1.13 [March 19, 2014]

Doesn't work - markers below infobox still receive mouseover/mouseout events
.


суббота, 17 марта 2012 г., 0:37:08 UTC+4 пользователь John Lauck написал:
Reply all
Reply to author
Forward
0 new messages