Hello, I'm trying to make the marker i'm currently hovering on have a
greater z-index than the others, so that even if it's hidden by other
markers it'll gain full visibility when I hover on it.
Here's my code so far:
-------------------------------------------------------
var marker = new google.maps.Marker({
position: latlng,
icon: image,
map: map
}); //leaving the default z-index here
google.maps.event.addListener(marker, "mouseover", function() {
this.old_ZIndex = this.getZIndex(); //trying to get the current
z-
index
console.log(this.old_ZIndex); //this is undefined: why?
this.setZIndex(100); //setting a higher z-index than all other
markers
showTooltip(this, marker.tooltip); //showing a tooltip
});
google.maps.event.addListener(marker, "mouseout", function() {
this.setZIndex(this.old_ZIndex); /*setting the old z-index value
when I hover out; not working because I have no old_ZIndex */
if (ib) ib.close(); //closing the tooltip
});
-------------------------------------------------------------------
This doesn't work, so I'm wondering how to do it correctly, as shown
for example in this website (which uses API v2):
http://milano.tonight.eu/locali
Thank you!
--
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.