let time = null;
let bounds = null;
google.maps.event.addListener(map,'bounds_changed',function(){
bounds = map.getBounds();
time = (new Date()).getTime();
setTimeout(function(){
let now = ((new Date()).getTime() - 999);
if(now > time){
console.log('now: '+now+ ' then: '+time+ ' diff: '+(now-time));
// here I want to fire an event exactly 1 time instead of a baizllion
alert('I just want to see this once after the map was moved');
}
},1000);
});
Essentially, when the map changes, the bounds_changed event seems to trigger quite frequently. My assumption that declaring time outside would prevent it from being overwritten may be incorrect.