fix: try to support pmtiles with fromdata set
I'm not sure how this is supposed to be used, but i don't want it to only be allowed in mbtiles Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
fa7ab7f81d
commit
a24a48bd1e
2 changed files with 11 additions and 3 deletions
|
|
@ -1488,7 +1488,8 @@ export const serve_rendered = {
|
||||||
inputFile = mapsTo;
|
inputFile = mapsTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DataInfo = dataResolver(inputFile);
|
let protocol = url.split(':')[0];
|
||||||
|
const DataInfo = dataResolver(inputFile, protocol);
|
||||||
if (DataInfo.inputfile) {
|
if (DataInfo.inputfile) {
|
||||||
inputFile = DataInfo.inputfile;
|
inputFile = DataInfo.inputfile;
|
||||||
source_type = DataInfo.filetype;
|
source_type = DataInfo.filetype;
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ function start(opts) {
|
||||||
let id = fileid.substr(0, fileid.lastIndexOf('.')) || fileid;
|
let id = fileid.substr(0, fileid.lastIndexOf('.')) || fileid;
|
||||||
while (data[id]) id += '_';
|
while (data[id]) id += '_';
|
||||||
data[id] = {
|
data[id] = {
|
||||||
mbtiles: fileid,
|
filename: fileid,
|
||||||
};
|
};
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
@ -239,7 +239,8 @@ function start(opts) {
|
||||||
item,
|
item,
|
||||||
id,
|
id,
|
||||||
opts.publicUrl,
|
opts.publicUrl,
|
||||||
(fileid) => {
|
(fileid, protocol) => {
|
||||||
|
//console.log(protocol);
|
||||||
let inputFile;
|
let inputFile;
|
||||||
let fileType;
|
let fileType;
|
||||||
for (const id of Object.keys(data)) {
|
for (const id of Object.keys(data)) {
|
||||||
|
|
@ -260,6 +261,12 @@ function start(opts) {
|
||||||
data[id].mbtiles,
|
data[id].mbtiles,
|
||||||
);
|
);
|
||||||
fileType = 'mbtiles';
|
fileType = 'mbtiles';
|
||||||
|
} else if (data[id].filename !== undefined) {
|
||||||
|
inputFile = path.resolve(
|
||||||
|
options.paths[protocol],
|
||||||
|
data[id].filename,
|
||||||
|
);
|
||||||
|
fileType = protocol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue