Marker Cluster icons displaying over single marker icons

1,209 views
Skip to first unread message

Gwen

unread,
Aug 2, 2011, 8:33:06 PM8/2/11
to Google Maps JavaScript API v3
Hi Group,

I have two types of markers, one set that clusters and a second that
does not.

Is there a way to have the nonclustered markers appear on top of the
cluster markers like a higher z-index?.

I've tried setting the z-index on the individual markers to be very
high but this is no good.

Any suggestions please?

Cheers,
Gwen
Message has been deleted

Gary Little

unread,
Aug 3, 2011, 9:06:58 PM8/3/11
to Google Maps JavaScript API v3
The marker clusterer places cluster icons in the overlayMouseTarget
pane which is "above" the overlayImage pane where markers reside.
That's why changing z-indexes doesn't affect the ordering: cluster
icons always appear above markers.

I believe the overlayMouseTarget pane was probably chosen to make it
easier to capture clicks on cluster icons (no need to set up a
transparent overlay as is done with markers). It might also have been
done for UI reasons -- to ensure that clusters weren't obscured by
other stuff on the map (i.e., the complete opposite to what you want).

If the cluster icons were standard markers in the overlayImage pane
you could probably get the effect you're looking for... but there may
be other negative side effects I haven't considered.

Gwen

unread,
Aug 3, 2011, 9:27:23 PM8/3/11
to Google Maps JavaScript API v3
Thanks Gary, I appreciate your time and the explanation makes perfect
sense.

Cheers,
Gwen
Reply all
Reply to author
Forward
0 new messages