diff --git a/js/id/behavior/drag_node.js b/js/id/behavior/drag_node.js index eff4c1174..e06bec43e 100644 --- a/js/id/behavior/drag_node.js +++ b/js/id/behavior/drag_node.js @@ -14,7 +14,7 @@ iD.behavior.DragNode = function(context) { function startNudge(nudge) { if (nudgeInterval) window.clearInterval(nudgeInterval); nudgeInterval = window.setInterval(function() { - context.map().pan(nudge).redraw(); + context.pan(nudge); }, 50); } diff --git a/js/id/id.js b/js/id/id.js index 5db609593..5b4b1fb73 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -85,6 +85,7 @@ window.iD = function () { context.projection = map.projection; context.tail = map.tail; context.redraw = map.redraw; + context.pan = map.pan; context.zoomIn = map.zoomIn; context.zoomOut = map.zoomOut; diff --git a/js/id/modes/move_way.js b/js/id/modes/move_way.js index 99a2ebb48..cdd9fa792 100644 --- a/js/id/modes/move_way.js +++ b/js/id/modes/move_way.js @@ -30,7 +30,7 @@ iD.modes.MoveWay = function(context, wayId) { function startNudge(nudge) { if (nudgeInterval) window.clearInterval(nudgeInterval); nudgeInterval = window.setInterval(function() { - context.map().pan(nudge).redraw(); + context.pan(nudge); }, 50); } diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 1bea28a17..29de5489b 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -241,7 +241,7 @@ iD.Map = function(context) { t[1] += d[1]; projection.translate(t); zoom.translate(projection.translate()); - return map; + return redraw(); }; map.size = function(_) { diff --git a/js/id/ui.js b/js/id/ui.js index 72712f861..6e7322848 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -2,8 +2,7 @@ iD.ui = function(context) { return function(container) { context.container(container); - var connection = context.connection(), - history = context.history(), + var history = context.history(), map = context.map(); if (!iD.detect().support) { @@ -103,8 +102,7 @@ iD.ui = function(context) { function pan(d) { return function() { - map.pan(d); - map.redraw(); + context.pan(d); }; }