Hi,

I wonder if this is possible? I click on a marker and the markers
image change and keep that image despite that mouseout would like to
change it back? I want the clicked marker to indicate that this is the
last selected marker along with an opened infobox. I tried to set a
variable to 1 when I clicked on the marker and then if the variable
was == 1 not use mouseout, but it didn't work! Perhaps there are
better solutions? Thanks!

This is a part of the code I use to my map:

var markerIcon1 = new google.maps.MarkerImage('bilder/bilder_ikoner/
icon1.png');
var markerIcon2 = new google.maps.MarkerImage('bilder/bilder_ikoner/
icon2.png');

                var marker = new google.maps.Marker({
                        map: map,
                        draggable: false,
                        center: position,
                        position: position,
                        visible: true,
                        html: infobox,
                        title: marker_title,
                        icon: markerIcon1
                });

                google.maps.event.addListener(marker, "click", function () {
                ib.setPosition(this.position);
                ib.setContent(this.html);
                ib.open(map);
                });

                // Mouseover
                google.maps.event.addListener(marker, 'mouseover', function() {
                this.setIcon(markerIcon2);
                });

                // Mouseout
                google.maps.event.addListener(marker, 'mouseout', function() {
                this.setIcon(markerIcon1);
                });

-- 
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.

Reply via email to