I've got two functions:
function showMarkers() {
hotspotsIterator = 0;
for(var i = 0; i < table.length; i++) {
var obj = table[i];
if(obj && obj.marker) {
var obj = table[i];
obj.marker.setMap(map);
}
}
}
function hideMarkers() {
for(var i = 0; i < table.length; i++) {
var obj = table[i];
if(obj && obj.marker) {
obj.marker.setMap(null);
}
}
}
First is showing markers, and second is hiding them. When I first use showMarkers() there is Animation.DROP performed. But when I hide them and show again, animation is not running, and the markers are simply shown.
Can someone tell me how to re-drop markers? Without creating new instances?
EDIT:
I have already created the code to re-create the same marker and it works, but its not elegant solution at all!
And Google Docs for markers doesn't resolve the issue.
Add following code right below the obj.marker.setMap(map);
: obj.marker.setAnimation(google.maps.Animation.DROP);
Here the reference: Marker Animations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With