是否有任何侦听器可以处理完全加载的地图?
在我的情况下,我需要从地图中获取界限,所以我已经这样做了:
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();
},
有没有不乱的方式?
答案 0 :(得分:89)
尝试类似:
google.maps.event.addListenerOnce(map, 'idle', function(){
//loaded fully
});
答案 1 :(得分:19)
tilesloaded
事件怎么样?
google.maps.event.addListener(map, 'tilesloaded', function() {
// Visible tiles loaded!
});