call painting tiles before issuing the command to cache them
authorRobert Kaiser <robert@widebook.box.kairo.at>
Sun, 30 Dec 2012 20:51:55 +0000 (21:51 +0100)
committerRobert Kaiser <robert@widebook.box.kairo.at>
Sun, 30 Dec 2012 20:51:55 +0000 (21:51 +0100)
js/map.js

index 9ffc81c..14b6921 100644 (file)
--- a/js/map.js
+++ b/js/map.js
@@ -678,8 +678,8 @@ var gTileService = {
       XHR.addEventListener("load", function () {
         if (XHR.status === 200) {
           var blob = XHR.response;
-          gTileService.setDBCache(dbkey, {image: blob, timestamp: Date.now()});
           aCallback(blob, aStyle, aCoords);
+          gTileService.setDBCache(dbkey, {image: blob, timestamp: Date.now()});
         }
       }, false);
       XHR.send();