Fix re-requesting failed tiles. Fixes #594

This commit is contained in:
Tom MacWright
2013-02-01 11:31:31 -05:00
parent 60850f303f
commit ab7290a865
+5 -2
View File
@@ -83,7 +83,10 @@ iD.Background = function() {
}
});
requests = uniqueBy(requests, 3);
requests = uniqueBy(requests, 3).filter(function(r) {
// don't re-request tiles which have failed in the past
return cache[r[3]] !== false;
});
function load(d) {
cache[d[3]] = true;
@@ -125,7 +128,7 @@ iD.Background = function() {
.attr('src', function(d) { return d[3]; })
.on('error', error)
.on('load', load);
image.style(transformProp, imageTransform);
if (Object.keys(cache).length > 100) cache = {};