fix: change center
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
68168ce7b6
commit
5f1b2814ba
1 changed files with 15 additions and 6 deletions
|
|
@ -55,18 +55,27 @@ export const GetPMtilesInfo = async (pmtiles) => {
|
||||||
metadata['minzoom'] = header.minZoom;
|
metadata['minzoom'] = header.minZoom;
|
||||||
metadata['maxzoom'] = header.maxZoom;
|
metadata['maxzoom'] = header.maxZoom;
|
||||||
|
|
||||||
if(header.minLon && header.minLat && header.maxLon && header.maxLat) {
|
if (header.minLon && header.minLat && header.maxLon && header.maxLat) {
|
||||||
metadata['bounds'] = [header.minLon, header.minLat, header.maxLon, header.maxLat];
|
metadata['bounds'] = [
|
||||||
|
header.minLon,
|
||||||
|
header.minLat,
|
||||||
|
header.maxLon,
|
||||||
|
header.maxLat,
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
metadata['bounds'] = [-180, -85.05112877980659, 180, 85.0511287798066];
|
metadata['bounds'] = [-180, -85.05112877980659, 180, 85.0511287798066];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(header.centerLon && header.centerLat && header.centerZoom) {
|
if (header.centerZoom) {
|
||||||
metadata['center'] = [header.centerLon, header.centerLat, header.centerZoom];
|
metadata['center'] = [
|
||||||
|
header.centerLon,
|
||||||
|
header.centerLat,
|
||||||
|
header.centerZoom,
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
metadata['center'] = [
|
metadata['center'] = [
|
||||||
(parseInt(metadata['bounds'][0]) + parseInt(metadata['bounds'][2])) / 2,
|
header.centerLon,
|
||||||
(parseInt(metadata['bounds'][1]) + parseInt(metadata['bounds'][3])) / 2,
|
header.centerLat,
|
||||||
parseInt(metadata['maxzoom']) / 2,
|
parseInt(metadata['maxzoom']) / 2,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue