2011-12-30 17 views
41

¿Hay algún oyente que maneje el mapa completamente cargado?Google Map v3 Evento cargado en el mapa

En mi caso, tengo que conseguir los límites de mapa, por lo que he hecho de esta manera:

google.maps.event.addListener(this.map, "bounds_changed", this.mapLoaded); 

mapLoaded: function() { 
    google.maps.event.clearListeners(this.map, "bounds_changed"); 

    var bounds = this.map.getBounds(); 

    this.collection.setBounds(bounds.getNorthEast(), bounds.getSouthWest()); 
    this.collection.fetch(); 
}, 

¿Hay alguna manera no-piratería?

Respuesta

89

intentar algo como:

google.maps.event.addListenerOnce(map, 'idle', function(){ 
    //loaded fully 
}); 
19

¿Qué tal caso tilesloaded?

google.maps.event.addListener(map, 'tilesloaded', function() { 
    // Visible tiles loaded! 
}); 
Cuestiones relacionadas