Use marker.setImage() to change the marker image in your mouseover and
mouseout handlers.

On Sep 17, 11:23 pm, pbmaps <[email protected]> wrote:
> On Sep 17, 11:48 am, David Cato <[email protected]> wrote:
>
> > It's a rather clever implementation. A lot of the code seems to exist
> > for handling different types of POIs (accomodations, transportation,
> > etc.) but the gist is that they have two markers: the base marker and
> > a modified version, displayed on mouseover, of the base marker that
> > has a "tang" on the right side to which the "flag" is attached.
>
> > Instead of placing the tooltip over the marker, it's placed adjacent
> > to the marker, thus avoiding the mouseover/mouseout problem the OP
> > has.
>
> Yes, I see. Thanks for working that out!
> I actually tried a similar but much cruder method by cropping a semi-
> circle out of my tooltip image, so it fits around the marker rather
> than over it. My solution is far from perfect though, and I'd like to
> try swapping the marker images on mouseover as visitsweden have done.
>
> I can define the 2 image 'states' with the following code:
> gicons["out"] = new GIcon(baseIcon,"out.png");
> gicons["over"] = new GIcon(baseIcon,"over.png");
>
> And the default 'out' state can be called by this code:
> var marker = new GMarker(point,gicons["out"]);
>
> But how do I swap the marker images on mouseover and then swap them
> back again on mouseout?
> For the side bar, I imagine the code would need to be added to the
> following functions.
>
>  function mymouseover(i) {
>         showTooltip(gmarkers[i])
>       }
>
>       function mymouseout() {
>         tooltip.style.visibility="hidden";
>       }
>
> Can anyone give me a hint as to what that code would be? I tried using
> marker.setIcon(gicons["over"]); but that did not work.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to