2012-03-02 12 views
6

Voglio visualizzare qualche animazione su infoWindow in google maps con jQuery.Come faccio a sapere che infowindow è già apparso in google maps

var infoWindow = new google.maps.InfoWindow({ 
    content: contentString 
    }); 
google.maps.event.addListener(marker, 'click', function(){ 
    infoWindow.open(map, marker); 
    setTimeout(animation, 1000); 
    }); 

animation() deve ottenere elementi per la sua identificazione in infowindow, in modo che l'infowindow deve terminare il caricamento prima animation() viene eseguito.

Come è possibile eseguire immediatamente animation() InfoFinitura di caricamento estremità invece di attendere 1 secondo ogni volta?

+0

Io in realtà non so la risposta, ma mi chiedo che infowindow è un oggetto DOM e quindi dovrebbe innescare eventi onload che si potrebbe ascoltare – slawekwin

+0

fa. aprire accettare una funzione di callback? prova infoWindow.open (map, marker, function() {animation();}); ? – Ohgodwhy

risposta

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

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

Problemi correlati