Restore leading event for move throttling

Hash updates turn out to be very timing sensitive.
While it's OK for drag gestures to be throttled with
a trailing edge, manual moves such as zooming to a
particular feature should always trigger a leading
edge update.

To recoup the performance, we could refactor the map
events to the standard movestart, move, and moveend,
and update the hash only on moveend.

Fixes #2023
This commit is contained in:
John Firebaugh
2013-11-26 11:26:30 -08:00
parent da3bf77c35
commit fb88b046cc
+1 -1
View File
@@ -30,7 +30,7 @@ iD.behavior.Hash = function(context) {
if (s0 !== s1) location.replace(s0 = s1); // don't recenter the map!
}
var move = _.throttle(update, 500, {leading: false});
var move = _.throttle(update, 500);
function hashchange() {
if (location.hash === s0) return; // ignore spurious hashchange events