eenkoex
eenkoex

Reputation: 53

Marker on top of OverlayView , GoogleMaps API V3 JavaScript

How can I render a custom OverlayView item behind a marker. When a marker and the overlayView item intersects, always overlayview item is drawn on top. Is there a way to adjust their z depth accordingly ?

Thanks

Upvotes: 2

Views: 3062

Answers (3)

Koen.
Koen.

Reputation: 26959

The overlayLayer pane is also rendered below the markers:

var panes = this.getPanes();
panes.overlayLayer.appendChild(div);

Upvotes: 1

Daniel Powers
Daniel Powers

Reputation: 109

Found the answer here.

In the onAdd method replace:

panes.overlayImage.appendChild(div);

with:

panes.mapPane.appendChild(div);

Upvotes: 8

Femi
Femi

Reputation: 64700

You'll probably need to adjust the z-order of the contents of the OverlayView, as outlined here. Make the DOM nodes in the OverlayView have lower z-order values than the marker.

Upvotes: 0

Related Questions