From 2e39f47d368ebaf29309234333f3429862c0d712 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 1 Nov 2012 10:59:56 -0400 Subject: [PATCH] Throttle hash changes --- js/iD/renderer/hash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/iD/renderer/hash.js b/js/iD/renderer/hash.js index 4fa60730d..066301a27 100644 --- a/js/iD/renderer/hash.js +++ b/js/iD/renderer/hash.js @@ -22,10 +22,10 @@ iD.Hash = function() { "/" + center.lon.toFixed(precision); }; - function move() { + var move = _.throttle(function() { var s1 = formatter(map); if (s0 !== s1) location.replace(s0 = s1); // don't recenter the map! - } + }, 1000); function hashchange() { if (location.hash === s0) return; // ignore spurious hashchange events