/ / Google मानचित्र मार्कर एनिमेशन मजाक नहीं कर रहा है - जावास्क्रिप्ट, google-maps, google-maps-api-3

Google मानचित्र मार्कर एनिमेशन मजाक नहीं कर रहा है - जावास्क्रिप्ट, google-maps, google-maps-api-3

यह कोड काम कर रहा है लेकिन जब मैं माउस प्रत्येक मार्कर पर क्लिक करता हूं, मार्कर एनीमेशन बॉन्स नहीं।

for(i=0; i<locations.length; i++) {
var position = new google.maps.LatLng(locations[i][2], locations[i][3]);
var marker = new google.maps.Marker({
position: position,
map: map,
icon: new google.maps.MarkerImage(locations[i][5]),
animation: google.maps.Animation.DROP
});
google.maps.event.addListener(marker, "click", (function(marker, i) {
return function() {
infowindow.setContent(locations[i][1]);
infowindow.setOptions({maxWidth: 500});
infowindow.open(map, marker);
}
animation: google.maps.Animation.BOUNCE

}) (marker, i));

Markers[locations[i][4]] = marker;
}

उत्तर:

जवाब के लिए 0 № 1

क्लिक-कॉलबैक में एनीमेशन सेट करें:

return function() {
//set the animation
this.setAnimation(google.maps.Animation.BOUNCE);

infowindow.setContent(locations[i][1]);
infowindow.setOptions({maxWidth: 500});
infowindow.open(map, marker);
}