change marker icon on mouseover ( google maps V3 )

后端 未结 2 439
不思量自难忘°
不思量自难忘° 2021-02-03 23:48
var image = \'bullets/_st_zzzzzzl SSS.gif\';

var bar1 = new google.maps.Marker({
    position: myLatLng, 
    map: map,
    icon: image,
    title: \"bar number 1\"             


        
2条回答
  •  你的背包
    2021-02-04 00:46

    google.maps.event.addListener(marker, 'mouseover', function() {
        infowindow.open(map, this);
    });
    
    // assuming you also want to hide the infowindow when user mouses-out
    google.maps.event.addListener(marker, 'mouseout', function() {
        infowindow.close();
    });
    

提交回复
热议问题