fix: bounds and center breaking index image
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
1b2b79113b
commit
4229a0cb04
2 changed files with 6 additions and 15 deletions
|
|
@ -134,7 +134,7 @@ const startWithPMTiles = async (pmtilesFile) => {
|
||||||
config['styles'][styleName] = {
|
config['styles'][styleName] = {
|
||||||
style: styleFileRel,
|
style: styleFileRel,
|
||||||
tilejson: {
|
tilejson: {
|
||||||
bounds: info.bounds,
|
bounds: metadata.bounds,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,23 +21,14 @@ export const GetPMtilesInfo = async (pmtilesFile) => {
|
||||||
const metadata = JSON.parse(dec.decode(metadataDecomp));
|
const metadata = JSON.parse(dec.decode(metadataDecomp));
|
||||||
|
|
||||||
//Add missing metadata from header
|
//Add missing metadata from header
|
||||||
metadata['format'] = GetPmtilesTileType(header.tileType).type;
|
const bounds = [header.minLon, header.minLat, header.maxLon, header.maxLat];
|
||||||
|
const center = [header.centerLon, header.centerLat, header.centerZoom];
|
||||||
|
|
||||||
if (
|
metadata['bounds'] = bounds;
|
||||||
header.minLat != 0 &&
|
metadata['center'] = center;
|
||||||
header.minLon != 0 &&
|
|
||||||
header.maxLat != 0 &&
|
|
||||||
header.maxLon != 0
|
|
||||||
) {
|
|
||||||
const bounds = [header.minLon, header.minLat, header.maxLon, header.maxLat];
|
|
||||||
metadata['bounds'] = bounds;
|
|
||||||
}
|
|
||||||
if (header.centerLon != 0 && header.centerLat != 0) {
|
|
||||||
const center = [header.centerLon, header.centerLat, header.centerZoom];
|
|
||||||
metadata['center'] = center;
|
|
||||||
}
|
|
||||||
metadata['minzoom'] = header.minZoom;
|
metadata['minzoom'] = header.minZoom;
|
||||||
metadata['maxzoom'] = header.maxZoom;
|
metadata['maxzoom'] = header.maxZoom;
|
||||||
|
metadata['format'] = GetPmtilesTileType(header.tileType).type;
|
||||||
|
|
||||||
return { header: header, metadata: metadata };
|
return { header: header, metadata: metadata };
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue