I'm using a legacy version of google maps.
I set up my markers like this, using Json data to fill in the variables:
var marker = createMarker(marker_id, point, course_name, phone, holes, ninefee, eightteenfee, ninefee_weekend, eightteenfee_weekend, ninefee_cart, eightteenfee_cart, teetimes, notes, map);
function createMarker(marker_id, point, course_name, phone, holes, ninefee, eightteenfee, ninefee_weekend, eightteenfee_weekend, ninefee_cart, eightteenfee_cart, teetimes, notes, map) {
var marker = new google.maps.Marker({
id: marker_id,
position: point,
map: map,
icon: {
path: "M128 0L416 128 175.5 234.9c.4 1.6 .5 3.3 .5 5.1v84.8c25.2-3.1 52.1-4.8 80-4.8c141.4 0 256 43 256 96s-114.6 96-256 96S0 469 0 416c0-35.5 51.5-66.6 128-83.2V256 240 0zm96 448c35.3 0 64-14.3 64-32s-28.7-32-64-32s-64 14.3-64 32s28.7 32 64 32z",
scale: 0.05,
strokeWeight: 0.2,
strokeColor: '#000000',
strokeOpacity: 1,
fillColor: '#08755F',
fillOpacity: 1
}
});
Now I'd like to reset the color on mouseover, but it isn't working:
google.maps.event.addListener(marker, "mouseover", function() {
marker.set("fillColor","#000000"); //nothing happens
});
I don't get any errors, but nothing happens. How do I set the color of the marker?