On Mar 18, 4:43 am, Gary Little <[email protected]> wrote:
> Chris,
>
> I too have been noticing unexpected problems in z ordering with V3.4,
> not sure if it's related to this problem, but it might be.
>
> In my case, I'm attempting to set the z-index of an OverlayView object
> based on the current z-index of an associated Marker so I can order
> them properly relative to one another (usually to force the
> OverlayView on top). Sometimes, though, the OverlayView object appears
> below the marker. I think this happens sometimes because the order in
> which objects are drawn on the map varies (or perhaps is random).
>
> When the map is zoomed, for example, this will affect the z-index of
> the DIV holding the Marker (because it's set to the vertical position
> if no explicit z-index has been set for the Marker). However, the
> OverlayView will not detect the change if the OverlayView is drawn
> *before* the Marker, so the relative ordering of the two objects may
> not work out as expected. (If the Marker were drawn first, there would
> be no problem.)
>
> To solve this problem, it would be beneficial if one could listen for
> an event that is fired when a Marker is drawn or redrawn (doesn't
> exist at the moment) or if the name of the Marker draw method were
> known.
>
> Any suggestions?
>
> Gary

You might have to add an "idle" event listener.  V2 did it
automatically with the "redraw(force)" method with "force=false".  V3
requires you to do it manually.  You might be able to cycle through
the childNodes of the "overlayView" map pane.  Assign a zIndex to your
OverlayView either above or below the the others.

All markers are rendered in a single CANVAS DOM element for each
tile.  The CANVAS tiles do not overlap.  The tiles have the zIndex of
their common parent node.  All markers are painted in zIndex order to
cause colors & opacities to combine correctly.  Painting order in the
tile does not change the zIndex of the tile itself or of its parent
node.

All markers in the same parent node of the CANVAS tile will be either
above or below your OverlayView.  If neither your OverlayView nor the
parent node of the CANVAS tiles have been assigned a zIndex, the
childNode order of map pane (1) will determine apparent zIndex
ordering.  Google has to rebuild its tiles to keep pace with
dragging / panning / zooming.  If the parent node also has to be
rebuilt, it will percolate toward the bottom of the childNode chain of
map pane (1) resulting in an apparent boost to the zIndex.  You could
compensate with "removeChild()" / "appendChild()" on your own
OverlayView to map pane (1)

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