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;
|
||||
}
|
||||
|
||||
const DataInfo = dataResolver(inputFile);
|
||||
let protocol = url.split(':')[0];
|
||||
const DataInfo = dataResolver(inputFile, protocol);
|
||||
if (DataInfo.inputfile) {
|
||||
inputFile = DataInfo.inputfile;
|
||||
source_type = DataInfo.filetype;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ function start(opts) {
|
|||
let id = fileid.substr(0, fileid.lastIndexOf('.')) || fileid;
|
||||
while (data[id]) id += '_';
|
||||
data[id] = {
|
||||
mbtiles: fileid,
|
||||
filename: fileid,
|
||||
};
|
||||
return id;
|
||||
}
|
||||
|
|
@ -239,7 +239,8 @@ function start(opts) {
|
|||
item,
|
||||
id,
|
||||
opts.publicUrl,
|
||||
(fileid) => {
|
||||
(fileid, protocol) => {
|
||||
//console.log(protocol);
|
||||
let inputFile;
|
||||
let fileType;
|
||||
for (const id of Object.keys(data)) {
|
||||
|
|
@ -260,6 +261,12 @@ function start(opts) {
|
|||
data[id].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