问题
I am implementing OL for a GIS application and want to add a 20 seconds timeout when the user scrolled the map, after which the GPS auto track function should resume.
For that I am utilizing the map.on('moveend', move_func(..)) listener. The problem is that it cannot differenciate whether the user scrolled or the position change came from map.setCenter(..). Although I could implement a state variable which is set to true every time map.setCenter() is called, this does not only seem un-elegant but also wrong in case the setCenter call and a user interaction would overlap.
So is there any better solution to this?
Regards
来源:https://stackoverflow.com/questions/36845572/open-layers-3-map-onmoveend-differentiate-between-user-interaction-and