Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes the draggable property of the google maps marker (v3) influence the zIndex of the marker?
    primarykey
    data
    text
    <p>I have a map, a marker with zIndex = 6, and when i click on it an infobox appears (zIndex: 5 and pane: "overlayImage"). So the marker and the tooltip are in the same pane so it depends of the zIndex which is on top and which is under. The problem that i have is that if the marker has (draggable: true) the zIndex compare works. (marker is on top because 6>5), but if i delete the draggable property, the marker will be under the infobox even if the zindex is higher than the infobox zIndex. </p> <p>Can somebody explain me why this happens? Code:</p> <pre><code>function initialize() { var secheltLoc = new google.maps.LatLng(49.47216, -123.76307); var myMapOptions = { zoom: 15 ,center: secheltLoc ,mapTypeId: google.maps.MapTypeId.ROADMAP }; var theMap = new google.maps.Map(document.getElementById("map_canvas"), myMapOptions); var marker = new google.maps.Marker({ map: theMap, draggable: true, position: new google.maps.LatLng(49.47216, -123.76307), zIndex: 6 }); var boxText = document.createElement("div"); boxText.style.cssText = "zindex: 3;border: 1px solid black; margin-top: 8px; background: yellow; padding: 5px;"; boxText.innerHTML = "City Hall, Sechelt&lt;br&gt;British Columbia&lt;br&gt;Canada"; var myOptions = { content: boxText ,disableAutoPan: false ,maxWidth: 0 ,pixelOffset: new google.maps.Size(-10, -20) ,zIndex: 5 ,boxStyle: { background: "url('tipbox.gif') no-repeat" ,opacity: 0.75 ,width: "280px" } ,closeBoxMargin: "10px 2px 2px 2px" ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif" ,infoBoxClearance: new google.maps.Size(1, 1) ,isHidden: false ,pane: "overlayImage" ,enableEventPropagation: false }; var ib = new InfoBox(myOptions); google.maps.event.addListener(marker, "mouseover", function (e) { ib.open(theMap, this); }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload