I would like to keep track of the coordinates of the center of my map. So far I\'ve been using this:
// On Drag End
google.maps.event.addListener(map, \'drag
Observe the idle-event instead(This event is fired when the map becomes idle after panning or zooming):
google.maps.event.addListener(map,'idle',function(){
if(!this.get('dragging') && this.get('oldCenter') && this.get('oldCenter')!==this.getCenter()) {
//do what you want to
}
if(!this.get('dragging')){
this.set('oldCenter',this.getCenter())
}
});
google.maps.event.addListener(map,'dragstart',function(){
this.set('dragging',true);
});
google.maps.event.addListener(map,'dragend',function(){
this.set('dragging',false);
google.maps.event.trigger(this,'idle',{});
});