简体   繁体   中英

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?

infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
      //do something
});

if(infowindow.getMap()){// TODO:}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM