Here's a rather ugly workround:
In the situation where the mouse has already moved on before the
floater.marker.setLatLng() has completed, we get a "mouseout" event on
the original marker but no "mousover" on the floater. So we can send a
custom event from the original marker to the floater to ask if it is OK.
GEvent.addListener(marker, "mouseout", function() {
GEvent.trigger(floater.marker,"ruok");
});
And in the floater, we can listen for that event and if the floater is
not OK it hides.
floater.marker.imok = false; // initial condition
// If not OK when the original marker mouseouts, then hide.
GEvent.addListener(floater.marker, 'ruok', function() {
if (!floater.marker.imok) {
floater.marker.hide();
document.getElementById("sidebar-item-"
+floater.id).style["backgroundColor"] = "";
}
});
// If a mouseover occurs on the floater, then it is OK
GEvent.addListener(floater.marker, 'mouseover', function() {
floater.marker.imok = true;
// sometimes things happen out of order,
floater.marker.show();
document.getElementById("sidebar-item-"
+floater.id).style["backgroundColor"] = "#F7F268";
});
And set floater.imok false when there's a real mouseout on the floater:
/* ... with a mouseout event listener ... */
GEvent.addListener(floater.marker, 'mouseout', function() {
/* Hide the marker and clear the sidebar highlight */
floater.marker.hide();
document.getElementById("sidebar-item-"
+floater.id).style["backgroundColor"] = "";
floater.marker.imok = false;
});
--
Mike Williams
http://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=en
-~----------~----~----~----~------~----~------~--~---