tileblaster 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builtins/cache.js +1 -1
- package/lib/store.js +3 -2
- package/package.json +18 -4
package/builtins/cache.js
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = function({ opts, data, res }, next, skip){
|
|
|
14
14
|
if (!cache.hasOwnProperty(data.map)) {
|
|
15
15
|
|
|
16
16
|
// store instance
|
|
17
|
-
cache.store = this.lib.store({ root: config.paths.data });
|
|
17
|
+
cache.store = this.lib.store({ root: config.paths.data, ext: config.id+".tmp" });
|
|
18
18
|
|
|
19
19
|
// merge opts of all uses of the cache builtin in a map config
|
|
20
20
|
opts = config.maps[data.map].filter(function(use){
|
package/lib/store.js
CHANGED
|
@@ -6,10 +6,11 @@ const path = require("node:path");
|
|
|
6
6
|
const xattr = require("fs-xattr");
|
|
7
7
|
const rfc822date = require("./rfc822date");
|
|
8
8
|
|
|
9
|
-
const store = module.exports = function store({ root }){
|
|
9
|
+
const store = module.exports = function store({ root, ext }){
|
|
10
10
|
if (!(this instanceof store)) return new store(...arguments);
|
|
11
11
|
|
|
12
12
|
this.root = path.resolve(process.cwd(), root);
|
|
13
|
+
this.ext = ext || ".tmp";
|
|
13
14
|
this.cache = {}; // FIXME use lru cache
|
|
14
15
|
|
|
15
16
|
return this;
|
|
@@ -79,7 +80,7 @@ store.prototype.put = function(tile, fn){
|
|
|
79
80
|
const self = this;
|
|
80
81
|
|
|
81
82
|
const destfile = path.join(self.root, tile.path);
|
|
82
|
-
const tmpfile = destfile+
|
|
83
|
+
const tmpfile = destfile+self.ext;
|
|
83
84
|
|
|
84
85
|
// check if exists and still valid?
|
|
85
86
|
self.check(destfile, function(err, isValid){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tileblaster",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "a quick and versatile map tile caching proxy",
|
|
5
5
|
"main": "tileblaster.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"fs-xattr": "^0.3.1",
|
|
26
26
|
"klaw": "^4.1.0",
|
|
27
27
|
"minimist": "^1.2.8",
|
|
28
|
-
"node-watch": "^0.7.
|
|
28
|
+
"node-watch": "^0.7.4",
|
|
29
29
|
"phin": "^3.7.0",
|
|
30
30
|
"quu": "^0.4.3"
|
|
31
31
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"mbg": "^0.0.2",
|
|
36
36
|
"node-liblzma": "^1.1.9",
|
|
37
37
|
"optipng-js": "^0.1.2",
|
|
38
|
-
"pmtiles": "^2.
|
|
38
|
+
"pmtiles": "^2.10.0",
|
|
39
39
|
"sharp": "^0.32.4",
|
|
40
40
|
"versatiles": "^0.3.1",
|
|
41
41
|
"vtt": "^0.0.3"
|
|
@@ -48,6 +48,20 @@
|
|
|
48
48
|
"linux"
|
|
49
49
|
],
|
|
50
50
|
"keywords": [
|
|
51
|
-
"tileblaster",
|
|
51
|
+
"tileblaster",
|
|
52
|
+
"tileserver",
|
|
53
|
+
"map",
|
|
54
|
+
"tiles",
|
|
55
|
+
"tile",
|
|
56
|
+
"mbtiles",
|
|
57
|
+
"versatiles",
|
|
58
|
+
"pmtiles",
|
|
59
|
+
"server",
|
|
60
|
+
"proxy",
|
|
61
|
+
"cache",
|
|
62
|
+
"vectortiles",
|
|
63
|
+
"rastertiles",
|
|
64
|
+
"mvt",
|
|
65
|
+
"pbf"
|
|
52
66
|
]
|
|
53
67
|
}
|