Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know infowindow has already popped up in google maps

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?

like image 761
onemach Avatar asked Mar 02 '12 08:03

onemach


People also ask

How do I know if infowindow is open?

Calling InfoWindow. getOpenedState() returns a boolean which reflects the state (opened/closed) of the infowindow.

What is infowindow in Google map?

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.

How do I get rid of infowindow in Google Maps?

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.


1 Answers

infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
      //do something
});
like image 61
Manatok Avatar answered Sep 22 '22 21:09

Manatok