tileblaster 0.4.7 → 0.4.8
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/lib/tileblaster.js +11 -9
- package/package.json +9 -3
package/lib/tileblaster.js
CHANGED
|
@@ -128,9 +128,9 @@ tileblaster.prototype.reconfigure = function(config){
|
|
|
128
128
|
|
|
129
129
|
// check for subdomain feature
|
|
130
130
|
if (map.url.indexOf("{s}") >= 0) {
|
|
131
|
-
if (!map.sub) throw new Error("no subdomains configured for map "+
|
|
131
|
+
if (!map.sub) throw new Error("no subdomains configured for map "+id);
|
|
132
132
|
if (typeof map.sub === "string") map.sub = map.sub.split("");
|
|
133
|
-
if (!(map.sub instanceof Array)) throw new Error("invalid 'sub' option for map "+
|
|
133
|
+
if (!(map.sub instanceof Array)) throw new Error("invalid 'sub' option for map "+id);
|
|
134
134
|
} else {
|
|
135
135
|
map.sub = false;
|
|
136
136
|
}
|
|
@@ -427,7 +427,7 @@ tileblaster.prototype.tile = function(mapid, z, x, y, r, e, fn){
|
|
|
427
427
|
if (self.maps[mapid].versatiles) return self.versatile(tileurl, mapid, z, x, y, next);
|
|
428
428
|
self.fetchtile(tileurl, mapid, next);
|
|
429
429
|
|
|
430
|
-
})(function(err, tilestream
|
|
430
|
+
})(function(err, tilestream){
|
|
431
431
|
|
|
432
432
|
if (err) {
|
|
433
433
|
if (stream !== null) {
|
|
@@ -552,11 +552,14 @@ tileblaster.prototype.fetchtile = function(tileurl, mapid, fn){
|
|
|
552
552
|
// get versatile
|
|
553
553
|
tileblaster.prototype.versatile = function(tileurl, mapid, z, x, y, fn) {
|
|
554
554
|
const self = this;
|
|
555
|
-
if (!
|
|
555
|
+
if (!versatiles) return fn(new Error("Missing dependency: versatiles"));
|
|
556
556
|
if (!self.maps[mapid].c) self.maps[mapid].c = versatiles(tileurl, { tms: !!self.maps[mapid].tms });
|
|
557
|
-
self.maps[mapid].c.getTile(z,x,y, function(err,
|
|
557
|
+
self.maps[mapid].c.getTile(z,x,y, function(err, buf){
|
|
558
558
|
if (err) return fn(err);
|
|
559
|
-
|
|
559
|
+
var strm = new stream.PassThrough;
|
|
560
|
+
strm.write(buf);
|
|
561
|
+
strm.end();
|
|
562
|
+
return fn(null, strm);
|
|
560
563
|
});
|
|
561
564
|
return self;
|
|
562
565
|
};
|
|
@@ -639,8 +642,7 @@ tileblaster.prototype.compress = function(file, comp){
|
|
|
639
642
|
};
|
|
640
643
|
|
|
641
644
|
// stream multiplexer
|
|
642
|
-
tileblaster.prototype._mux = function(
|
|
643
|
-
var self = this;
|
|
645
|
+
tileblaster.prototype._mux = function(){
|
|
644
646
|
|
|
645
647
|
// create a passthrough stream for every callback argument
|
|
646
648
|
// call back with created stream
|
|
@@ -654,7 +656,7 @@ tileblaster.prototype._mux = function(fn){
|
|
|
654
656
|
return (new stream.Writable({
|
|
655
657
|
write: function(chunk, encoding, done) {
|
|
656
658
|
streams.forEach(function(stream){
|
|
657
|
-
stream.write(chunk);
|
|
659
|
+
stream.write(chunk, encoding);
|
|
658
660
|
});
|
|
659
661
|
done();
|
|
660
662
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tileblaster",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "pretty fast optimizing & compressing tile caching proxy",
|
|
5
5
|
"main": "lib/tileblaster.js",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"homepage": "https://github.com/yetzt/tileblaster#readme",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"dur": "^0.0.3",
|
|
21
|
-
"klaw": "^
|
|
21
|
+
"klaw": "^3.0.0",
|
|
22
22
|
"minimist": "^1.2.8",
|
|
23
23
|
"node-watch": "^0.7.3",
|
|
24
24
|
"phin": "^3.7.0",
|
|
@@ -31,5 +31,11 @@
|
|
|
31
31
|
"nsa": "^0.2",
|
|
32
32
|
"pnck": "^1.0.1",
|
|
33
33
|
"versatiles": "^0.3.0"
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">= 10"
|
|
37
|
+
},
|
|
38
|
+
"os": [
|
|
39
|
+
"!win32"
|
|
40
|
+
]
|
|
35
41
|
}
|