fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
371e757e5b
commit
08b3a943a6
2 changed files with 24 additions and 21 deletions
10
src/main.js
10
src/main.js
|
|
@ -143,10 +143,7 @@ const startWithInputFile = async (inputfile) => {
|
|||
console.log(
|
||||
`WARN: PMTiles not in "openmaptiles" format. Serving raw data only...`,
|
||||
);
|
||||
config['data'][
|
||||
(metadata.id || 'mbtiles')
|
||||
.replace(/[?/:]/g, '_')
|
||||
] = {
|
||||
config['data'][(metadata.id || 'mbtiles').replace(/[?/:]/g, '_')] = {
|
||||
mbtiles: path.basename(inputfile),
|
||||
};
|
||||
}
|
||||
|
|
@ -201,10 +198,7 @@ const startWithInputFile = async (inputfile) => {
|
|||
console.log(
|
||||
`WARN: MBTiles not in "openmaptiles" format. Serving raw data only...`,
|
||||
);
|
||||
config['data'][
|
||||
(info.id || 'mbtiles')
|
||||
.replace(/[?/:]/g, '_')
|
||||
] = {
|
||||
config['data'][(info.id || 'mbtiles').replace(/[?/:]/g, '_')] = {
|
||||
mbtiles: path.basename(inputfile),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1221,7 +1221,7 @@ export const serve_rendered = {
|
|||
ratio: ratio,
|
||||
request: async (req, callback) => {
|
||||
const protocol = req.url.split(':')[0];
|
||||
console.log('Handling request:', req);
|
||||
console.log('Handling request:', req);
|
||||
if (protocol === 'sprites') {
|
||||
const dir = options.paths[protocol];
|
||||
const file = unescape(req.url).substring(protocol.length + 3);
|
||||
|
|
@ -1257,13 +1257,22 @@ export const serve_rendered = {
|
|||
const y = parts[5].split('.')[0] | 0;
|
||||
const format = parts[5].split('.')[1];
|
||||
|
||||
if (typeof map.sources[sourceId] === 'string' && map.sources[sourceId].split('.').pop().toLowerCase() === 'pmtiles') {
|
||||
let tileinfo = await GetPMtilesTile(map.sources[sourceId], z, x, y);
|
||||
if (
|
||||
typeof map.sources[sourceId] === 'string' &&
|
||||
map.sources[sourceId].split('.').pop().toLowerCase() ===
|
||||
'pmtiles'
|
||||
) {
|
||||
let tileinfo = await GetPMtilesTile(
|
||||
map.sources[sourceId],
|
||||
z,
|
||||
x,
|
||||
y,
|
||||
);
|
||||
let data = tileinfo.data;
|
||||
let headers = tileinfo.header;
|
||||
if (data == undefined) {
|
||||
if (options.verbose)
|
||||
console.log('MBTiles error, serving empty', err);
|
||||
console.log('MBTiles error, serving empty', err);
|
||||
createEmptyResponse(
|
||||
sourceInfo.format,
|
||||
sourceInfo.color,
|
||||
|
|
|
|||
Loading…
Reference in a new issue