From 64445e50ac82ef4ce44da30f98058cb1bfb88de7 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 22 Jan 2013 14:17:27 -0500 Subject: [PATCH] Slow and fast redraw --- js/id/renderer/map.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 0a77aedc6..b228ea765 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -149,7 +149,7 @@ iD.Map = function() { tilegroup.style(transformProp, transform); surface.style(transformProp, transform); - redraw(); + queueRedraw(); } function resetTransform() { @@ -158,7 +158,7 @@ iD.Map = function() { tilegroup.style(transformProp, ''); } - var redraw = _.debounce(function(difference) { + function redraw(difference) { resetTransform(); dispatch.move(map); surface.attr('data-zoom', ~~map.zoom()); @@ -173,7 +173,9 @@ iD.Map = function() { projection.scale(), projection.translate().slice()]; return map; - }, 200); + } + + var queueRedraw = _.debounce(redraw, 200); function pointLocation(p) { var translate = projection.translate(),