Hah! Interesting. In other words, if I add a colorrollovermarker
*over* a blackandwhitemarker, the colorrollovermarker takes control
of the mouse. Well, could I add a mouseout event to the
colorrollovermarker(s) to remove themselves?
I had thought that I'd need to add a click function to the
colorrollovermarker(s) in case the user clicked one. I hoped the event
would be to open the corresponding blackandwhitemarker's infowindow,
and then remove itself. But if setting the colorrollovermarker(s) to
be nonclickable is necessary, so much the better. Wouldn't that mean a
click would be transferred down through the colorrollovermarker to its
underlying blackandwhitemarker? So the blackandwhitemarker could open
its infowindow and close its colorrollovermarker, if the
colorrollovermarker was present.
All these things are worth a try. I've spent hours just trying to
write whatever code I need to enable the basic "adding the
corresponding marker" mouseover. A few more experimenting with what
might happen if it ever worked will be OK by me. There are hundreds of
posts about "bringing a marker to the front when rolled over." Has
this desirable action never been accomplished? I can't find a solution
anywhere.
So can you or some other kind soul tell me how to make a
blackandwhitemarker conjure up its corresponding colorrollovermarker?
Both arrays are identical --they are both built from the exact same
XML document-- except for their icons. The
function makeSidebar() {
var oldheader;
var html = "";
for (var i=0; i<blackandwhitemarkers.length; i++) {
if (!blackandwhitemarkers[i].isHidden()) {
var header = blackandwhitemarkers[i].myheader;
if (oldheader != header) html += "<b>" + header+ "</b><br>";
html += '<a href="javascript:myclick(' + i + ')"
onmouseover="map.addOverlay(colorrollovermarkers['+i+'])"
onmouseout="map.removeOverlay(colorrollovermarkers['+i+'])">' +
blackandwhitemarkers[i].myname + '<\/a><br>';
oldheader = header;
}
}
document.getElementById("side_bar").innerHTML = html;
}
code works perfectly, so it's obviously possible to call the
colorrollovermarkers by a reference to some [i] variable corresponding
to that of their blackandwhitemarkers. I just can't figure out how to
write it for a single marker pair, to add it to the Listener. Let's
give it a whirl! Maybe we'll invent something nifty!
On Feb 25, 5:18 am, Esa <[email protected]> wrote:
> On Feb 25, 9:30 am, BuckyE <[email protected]> wrote:
>
> > But I can't make the same function work from the markers. Obviously
> > the code
> > GEvent.addListener(marker, "mouseover", function() {
> > map.addOverlay(colorrollovermarkers[marker.myindex]);
> > });
> > is failing.
>
> That might work better but I can see in your link:
>
> GEvent.addListener(marker, "mouseover", function() {
> map.addOverlay(colorrollovermarkers[i]);
> });
>
> Where the value of 'i' is not passed to the function. So at the moment
> of "mouseover" the value of 'i' is wrong.
>
> It's not my intention to depress you, but I am afraid you are going to
> face new problems. What happens if you addOverlay() a new marker by
> "mouseover" of certainMarker. I am not sure if you get "mouseout" of
> certainMarker ever. I think that is fixed by setting the overlaid
> hilighting marker {clickable:false}.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---