Skip to content

Commit

Permalink
mapRotating is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick committed Dec 17, 2016
1 parent 5e9b884 commit 0cc56c6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions js/ui/bind_handlers.js
Expand Up @@ -17,7 +17,6 @@ module.exports = function bindHandlers(map, options) {
const el = map.getCanvasContainer();
let contextMenuEvent = null;
let mouseDown = false;
let mapRotating = false;
let startPos = null;
let tapped = null;

Expand Down Expand Up @@ -62,16 +61,12 @@ module.exports = function bindHandlers(map, options) {

contextMenuEvent = null;
mouseDown = false;
mapRotating = false;
fireMouseEvent('mouseup', e);
}

function onMouseMove(e) {
if (map.dragPan && map.dragPan.isActive()) return;
if (map.dragRotate && map.dragRotate.isActive()) {
mapRotating = true;
return;
}
if (map.dragRotate && map.dragRotate.isActive()) return;

let target = e.toElement || e.target;
while (target && target !== el) target = target.parentNode;
Expand Down Expand Up @@ -127,7 +122,7 @@ module.exports = function bindHandlers(map, options) {

function onContextMenu(e) {
const rotating = map.dragRotate && map.dragRotate.isActive();
if (!mouseDown && !rotating && !mapRotating) {
if (!mouseDown && !rotating) {
// Windows: contextmenu fired on mouseup, so fire event now
fireMouseEvent('contextmenu', e);
} else if (mouseDown) {
Expand Down

0 comments on commit 0cc56c6

Please sign in to comment.