Skip to content

Commit

Permalink
fix: remove unneeded extension I added
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Calcutt <[email protected]>
  • Loading branch information
acalcutt committed Oct 15, 2023
1 parent f1be7d2 commit dbdf2a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/serve_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const serve_data = {
return res.sendStatus(404);
}
const tileJSONFormat = item.tileJSON.format;
const tileJSONExtension = item.tileJSON.extension;
const z = req.params.z | 0;
const x = req.params.x | 0;
const y = req.params.y | 0;
Expand All @@ -54,7 +53,7 @@ export const serve_data = {
) {
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);
if (tileinfo == undefined || tileinfo.data == undefined) {
return res.status(404).send('Not found');
Expand Down Expand Up @@ -100,7 +99,7 @@ export const serve_data = {

return res.status(200).send(data);
}
} else {
} else if (item.source_type === 'mbtiles') {
item.source.getTile(z, x, y, (err, data, headers) => {
let isGzipped;
if (err) {
Expand Down Expand Up @@ -232,7 +231,6 @@ export const serve_data = {

tileJSON['name'] = id;
tileJSON['format'] = 'pbf';
tileJSON['extension'] = 'pmtiles';
Object.assign(tileJSON, metadata);

tileJSON['tilejson'] = '2.0.0';
Expand Down Expand Up @@ -261,7 +259,6 @@ export const serve_data = {
}
tileJSON['name'] = id;
tileJSON['format'] = 'pbf';
tileJSON['extension'] = 'mbtiles';

Object.assign(tileJSON, info);

Expand Down
2 changes: 0 additions & 2 deletions src/serve_rendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,6 @@ export const serve_rendered = {
}

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

const type = source.type;
info['extension'] = 'mbtiles';
Object.assign(source, info);
source.type = type;
source.tiles = [
Expand Down

0 comments on commit dbdf2a1

Please sign in to comment.