答案 0 :(得分:3)
将此添加到divs css
var marker, i;
var markers = [];
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map,
icon: 'img/markers/t1.png',
id: locations[i][3]
});
markers.push(marker);
marker.addListener('mouseover', function() {
marker.setIcon("img/serve-bracket.png");
});
}
}