I have an application using OpenLayers 6 where I am listening to map.getView().on('change:resolution', ...)
.
When the user zooms with the scroll wheel on the mouse, my handler gets blasted with dozens of events with intermediate zoom levels (between start and end zoom values).
My handler function is compute intensive, and I only want to receive the event with the last and final zoom level.
As a work-around, I have some code that stores the latest event, and then calls the real handler after 500ms. The code is ugly and becoming complex to maintain. Is there a better way to handle this in OpenLayers?
moveend
event get called for each iteration of the scroll-wheel events? See the accepted answer for a method using themoveend
event at: gis.stackexchange.com/questions/309387/…