I want to display some animation on infoWindow in google maps with jQuery.
var infoWindow = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(marker, 'click', function(){
infoWindow.open(map, marker);
setTimeout(animation, 1000);
});
animation()
has to get element by its id on infoWindow, so the infoWindow must finish loading before animation()
is executed.
How can I execute animation()
immediately afer infoWindow finish loading instead of waiting 1 second every time?
Calling InfoWindow. getOpenedState() returns a boolean which reflects the state (opened/closed) of the infowindow.
An InfoWindow displays content (usually text or images) in a popup window above the map, at a given location. The info window has a content area and a tapered stem. The tip of the stem is attached to a specified location on the map. Info windows appear as a Dialog to screen readers.
After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect.
infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
//do something
});
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