Last active
March 17, 2016 04:25
-
-
Save bhousel/bd85c95b1a87adfc6472 to your computer and use it in GitHub Desktop.
Debug Events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['touchstart', 'touchend', 'touchcancel', | |
'mousedown', 'mouseup', | |
'click', 'dblclick', 'contextmenu', | |
'dragstart', 'dragend', | |
'movestart', 'moveend', | |
'zoomstart', 'zoomend', | |
'rotatestart', 'rotateend', | |
'pitchstart', 'pitchend', | |
'boxzoomstart', 'boxzoomend', 'boxzoomcancel' | |
].forEach(function (type) { | |
map.off(type).on(type, function(data) { | |
var e = (data && data.originalEvent) || {}; | |
var dbg = | |
(data.point ? ' point = ' + JSON.stringify(data.point) : '') + | |
(e.buttons ? ' buttons = ' + e.buttons : '') + | |
(e.button ? ' button = ' + e.button : ''); | |
console.log(type + dbg); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment