projects
/
lantea.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d7cdcf
)
make tile cache aging/reloading actually work
author
Robert Kaiser
<kairo@kairo.at>
Mon, 31 Dec 2012 01:01:16 +0000
(
02:01
+0100)
committer
Robert Kaiser
<kairo@kairo.at>
Mon, 31 Dec 2012 01:01:16 +0000
(
02:01
+0100)
js/map.js
patch
|
blob
|
blame
|
history
diff --git
a/js/map.js
b/js/map.js
index 14b692187b95388931c5674d24fa28a4a84d061f..1d0c16d6056a66c23e69c01e88a6f2411194fc0d 100644
(file)
--- a/
js/map.js
+++ b/
js/map.js
@@
-649,7
+649,7
@@
function clearTrack() {
var gTileService = {
objStore: "tilecache",
var gTileService = {
objStore: "tilecache",
- ageLimit: 14 * 86400
, // 2 weeks
+ ageLimit: 14 * 86400
* 1000, // 2 weeks (in ms)
get: function(aStyle, aCoords, aCallback) {
var norm = normalizeCoords(aCoords);
get: function(aStyle, aCoords, aCallback) {
var norm = normalizeCoords(aCoords);
@@
-659,10
+659,11
@@
var gTileService = {
// We did get a cached object.
aCallback(aResult.image, aStyle, aCoords);
// Look at the timestamp and return if it's not too old.
// We did get a cached object.
aCallback(aResult.image, aStyle, aCoords);
// Look at the timestamp and return if it's not too old.
- if (aResult.timestamp +
this
.ageLimit > Date.now())
+ if (aResult.timestamp +
gTileService
.ageLimit > Date.now())
return;
// Reload cached tile otherwise.
return;
// Reload cached tile otherwise.
- console.log("reload cached tile: " + dbkey);
+ var oldDate = new Date(aResult.timestamp);
+ console.log("reload cached tile: " + dbkey + " - " + oldDate.toUTCString());
}
// Retrieve image from the web and store it in the cache.
var XHR = new XMLHttpRequest();
}
// Retrieve image from the web and store it in the cache.
var XHR = new XMLHttpRequest();