I am using the onCameraChanged function to grab the bounds of the map window and hit an api to populate markers on the map. What I am seeing is if I slow drag the whole map the onCameraChanged function is getting called a bunch of times in a very short period of time.
What would be a good way to prevent the multiple calls from happening?
I was thinking I could create a variable called isBusy, the first time the onCameraChanged function is run it would set isBusy=true. When when finished it would set isBusy = false. If the onCameraChanged function is called again while the first one is still running it would see isBusy is true and stop.