order requests to inprove the odds of getting missing tile data when some requests are likely to timeout, by putting uncached tile ids at the start of the request, cached (but stale) at the end
This commit is contained in:
parent
45abe9dfdc
commit
e9b05d7aa0
@ -152,13 +152,24 @@ window.requestData = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
requestTileCount++;
|
requestTileCount++;
|
||||||
tiles[bucket].push(generateBoundsParams(
|
|
||||||
|
var boundsParam = generateBoundsParams(
|
||||||
tile_id,
|
tile_id,
|
||||||
latSouth,
|
latSouth,
|
||||||
lngWest,
|
lngWest,
|
||||||
latNorth,
|
latNorth,
|
||||||
lngEast
|
lngEast
|
||||||
));
|
);
|
||||||
|
|
||||||
|
// when the server is returning 'timeout' errors for some tiles in the list, it's always the tiles
|
||||||
|
// at the end of the request. therefore, let's push tiles we don't have cache entries for to the front, and those we do to the back
|
||||||
|
if (getDataCache(tile_id)) {
|
||||||
|
// cache entry exists - push to back
|
||||||
|
tiles[bucket].push(boundsParam);
|
||||||
|
} else {
|
||||||
|
// no cache entry - unshift to front
|
||||||
|
tiles[bucket].unshift(boundsParam);
|
||||||
|
}
|
||||||
|
|
||||||
debugSetTileColour(tile_id,'#00f','#000');
|
debugSetTileColour(tile_id,'#00f','#000');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user