I have an OpenLayers 3 map with a source of ol.source.MapQuest({ layer: 'osm' })
. I haven't added a DragPan interaction, but the map is draggable anyway - which I want it to be.
I also have a click event for the map:
$(MapUtility.map.getViewport()).on('click', function(e) {
//Stuff
});
which fires every time I finish dragging the map.
I used to have a similar problem with a DragBox interaction and solved it by calling e.preventDefault()
at the start of my boxend event. However, that was an interaction I added and wrote the event for. The DragPan is in ol.js and I'd rather not change that if possible.
Is there something I can do in my click event to check whether the click was caused by DragPan? Alternatively, is there a way to amend the behaviour of this instance of the DragPan interaction without changing it globally?