Monday, May 20, 2024
-1
rated 0 times [  4] [ 5]  / answers: 1 / hits: 42455  / 13 Years ago, fri, december 30, 2011, 12:00:00

Is there any listener to handle map completely loaded?



In my case, I need to get bounds from map, so I've done it this way:



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();
},


Is there any not-hacking way?


More From » google-maps-api-3

 Answers
72

Try something like:



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

[#88317] Wednesday, December 28, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jazminkyrap

Total Points: 631
Total Questions: 89
Total Answers: 109

Location: Finland
Member since Fri, Oct 21, 2022
2 Years ago
;