My question is pretty straight forward.
google.maps.event.addListenerOnce(map, 'idle', function() {
// code
});
This snippet of code will trigger after the map is currently busy zooming or panning. Not when it’s already idle.
Is there a way to check the status of the canvas in an if statement? So when it’s already idle you’ll do the // code without adding a listener?
There is no documented property that signals the idle-status of the map, but you may implement it on your own.
Assuming you call this right after the initialization of the map:
Then you may check if the lastBounds-property is equal to the current bounds of the map: