refactor: only pass back metadata
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
5ce9dddf0d
commit
a5cc66729d
4 changed files with 4 additions and 7 deletions
|
|
@ -128,8 +128,7 @@ const startWithinputFile = async (inputFile) => {
|
|||
const extension = inputFile.split('.').pop().toLowerCase();
|
||||
if (extension === 'pmtiles') {
|
||||
let FileOpenInfo = PMtilesOpen(inputFile);
|
||||
const info = await GetPMtilesInfo(FileOpenInfo.pmtiles);
|
||||
const metadata = info.metadata;
|
||||
const metadata = await GetPMtilesInfo(FileOpenInfo.pmtiles);
|
||||
if (FileOpenInfo.fd !== undefined) {
|
||||
PMtilesClose(FileOpenInfo.fd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export const GetPMtilesInfo = async (pmtiles) => {
|
|||
metadata['maxzoom'] = header.maxZoom;
|
||||
metadata['format'] = GetPmtilesTileType(header.tileType).type;
|
||||
|
||||
return { header: header, metadata: metadata };
|
||||
return metadata;
|
||||
};
|
||||
|
||||
export const GetPMtilesTile = async (pmtiles, z, x, y) => {
|
||||
|
|
|
|||
|
|
@ -226,8 +226,7 @@ export const serve_data = {
|
|||
let source_type;
|
||||
if (inputType === 'pmtiles') {
|
||||
let FileOpenInfo = PMtilesOpen(inputFile);
|
||||
const info = await GetPMtilesInfo(FileOpenInfo.pmtiles);
|
||||
const metadata = info.metadata;
|
||||
const metadata = await GetPMtilesInfo(FileOpenInfo.pmtiles);
|
||||
source = FileOpenInfo.pmtiles;
|
||||
source_type = 'pmtiles';
|
||||
|
||||
|
|
|
|||
|
|
@ -1503,8 +1503,7 @@ export const serve_rendered = {
|
|||
|
||||
if (source_type === 'pmtiles') {
|
||||
let FileOpenInfo = PMtilesOpen(inputFile);
|
||||
const info = await GetPMtilesInfo(FileOpenInfo.pmtiles);
|
||||
const metadata = info.metadata;
|
||||
const metadata = await GetPMtilesInfo(FileOpenInfo.pmtiles);
|
||||
map.sources[name] = FileOpenInfo.pmtiles;
|
||||
map.source_types[name] = 'pmtiles';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue