fix: remove unneeded extension I added

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
Andrew Calcutt 2023-10-15 02:36:33 -04:00
parent f1be7d29dc
commit dbdf2a1075
2 changed files with 2 additions and 7 deletions

View file

@ -29,7 +29,6 @@ export const serve_data = {
return res.sendStatus(404); return res.sendStatus(404);
} }
const tileJSONFormat = item.tileJSON.format; const tileJSONFormat = item.tileJSON.format;
const tileJSONExtension = item.tileJSON.extension;
const z = req.params.z | 0; const z = req.params.z | 0;
const x = req.params.x | 0; const x = req.params.x | 0;
const y = req.params.y | 0; const y = req.params.y | 0;
@ -54,7 +53,7 @@ export const serve_data = {
) { ) {
return res.status(404).send('Out of bounds'); return res.status(404).send('Out of bounds');
} }
if (tileJSONExtension === 'pmtiles') { if (item.source_type === 'pmtiles') {
let tileinfo = await GetPMtilesTile(item.source, z, x, y); let tileinfo = await GetPMtilesTile(item.source, z, x, y);
if (tileinfo == undefined || tileinfo.data == undefined) { if (tileinfo == undefined || tileinfo.data == undefined) {
return res.status(404).send('Not found'); return res.status(404).send('Not found');
@ -100,7 +99,7 @@ export const serve_data = {
return res.status(200).send(data); return res.status(200).send(data);
} }
} else { } else if (item.source_type === 'mbtiles') {
item.source.getTile(z, x, y, (err, data, headers) => { item.source.getTile(z, x, y, (err, data, headers) => {
let isGzipped; let isGzipped;
if (err) { if (err) {
@ -232,7 +231,6 @@ export const serve_data = {
tileJSON['name'] = id; tileJSON['name'] = id;
tileJSON['format'] = 'pbf'; tileJSON['format'] = 'pbf';
tileJSON['extension'] = 'pmtiles';
Object.assign(tileJSON, metadata); Object.assign(tileJSON, metadata);
tileJSON['tilejson'] = '2.0.0'; tileJSON['tilejson'] = '2.0.0';
@ -261,7 +259,6 @@ export const serve_data = {
} }
tileJSON['name'] = id; tileJSON['name'] = id;
tileJSON['format'] = 'pbf'; tileJSON['format'] = 'pbf';
tileJSON['extension'] = 'mbtiles';
Object.assign(tileJSON, info); Object.assign(tileJSON, info);

View file

@ -1518,7 +1518,6 @@ export const serve_rendered = {
} }
const type = source.type; const type = source.type;
metadata['extension'] = 'pmtiles';
Object.assign(source, metadata); Object.assign(source, metadata);
source.type = type; source.type = type;
source.tiles = [ source.tiles = [
@ -1564,7 +1563,6 @@ export const serve_rendered = {
} }
const type = source.type; const type = source.type;
info['extension'] = 'mbtiles';
Object.assign(source, info); Object.assign(source, info);
source.type = type; source.type = type;
source.tiles = [ source.tiles = [