mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Performance improvement. Debounce redraw call.
This commit is contained in:
@@ -217,8 +217,6 @@ export function Map(context) {
|
||||
function redraw(difference, extent) {
|
||||
if (!surface || !redrawEnabled) return;
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
|
||||
// If we are in the middle of a zoom/pan, we can't do differenced redraws.
|
||||
// It would result in artifacts where differenced entities are redrawn with
|
||||
// one transform and unchanged entities with another.
|
||||
@@ -254,10 +252,7 @@ export function Map(context) {
|
||||
return map;
|
||||
}
|
||||
|
||||
var timeoutId;
|
||||
function queueRedraw() {
|
||||
timeoutId = setTimeout(function() { redraw(); }, 750);
|
||||
}
|
||||
var queueRedraw = _.debounce(redraw, 750);
|
||||
|
||||
function pointLocation(p) {
|
||||
var translate = projection.translate(),
|
||||
|
||||
Reference in New Issue
Block a user