Greetings! I am currently working on an ajax call that includes this function:
for(var i in data){
setTimeout((function(i) {
return function(){
CreateMarker(data[i]);
};
})(i), i*500);
}
This function adds markers to a Google map, utilizing google.maps.Animation.DROP
.
I would like to change the drop animation to
setAnimation(google.maps.Animation.BOUNCE)
once all the markers are on the map. I do know how to switch animations.
My predicament is as follows: While I can determine when the ajax call has concluded, the timeout causes difficulty in identifying when all markers have been "dropped" onto the map, leading to delay in changing the animation.
Does anyone have suggestions on how I can accurately detect when all markers have been placed on the map so that I can modify the animation? Thank you!