Identifying if a map moveend event was user initiated
问题 I registered a 'moveend' event listener on my ol.Map. It's firing when the map is moved around by user input, but also when I call ol.View.setCenter and ol.View.setResolution. Is it possible to check the 'moveend' ol.MapEvent to determine if the event was triggered by user input or from manually changing the map view's properties? 回答1: I ended up doing the following. map.on('moveend', function(event) { var mapView = map.getView(), moveInitiatedProgrammatically = mapView.get(