google maps v3 API mouseover with polygons?

后端 未结 4 1824
难免孤独
难免孤独 2021-01-31 09:20

I\'m building a map using the google v3 api because it is way faster. Essentially, it\'s a map of an area with about 30 cities with polygons over the regions. When a user hovers

4条回答
  •  庸人自扰
    2021-01-31 10:18

    The following works:

    google.maps.event.addListener(polygon,"mouseover",function(){
     this.setOptions({fillColor: "#00FF00"});
    }); 
    
    google.maps.event.addListener(polygon,"mouseout",function(){
     this.setOptions({fillColor: "#FF0000"});
    });
    

提交回复
热议问题