fix: resolves Unimplemented type: 3 error for geojson format (#1465)
* fix: resolves Unimplemented type: 3 error for geojson format * fix: removing duplicate zlib import * fix: remove redundant change to headers * revert fix decimal length * lint fix --------- Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
6d1c617752
commit
8a7d9957fb
1 changed files with 6 additions and 4 deletions
|
@ -21,6 +21,7 @@ import { openMbTilesWrapper } from './mbtiles_wrapper.js';
|
||||||
|
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
const packageJson = JSON.parse(
|
const packageJson = JSON.parse(
|
||||||
fs.readFileSync(
|
fs.readFileSync(
|
||||||
path.dirname(fileURLToPath(import.meta.url)) + '/../package.json',
|
path.dirname(fileURLToPath(import.meta.url)) + '/../package.json',
|
||||||
|
@ -113,12 +114,13 @@ export const serve_data = {
|
||||||
let headers = fetchTile.headers;
|
let headers = fetchTile.headers;
|
||||||
let isGzipped = data.slice(0, 2).indexOf(Buffer.from([0x1f, 0x8b])) === 0;
|
let isGzipped = data.slice(0, 2).indexOf(Buffer.from([0x1f, 0x8b])) === 0;
|
||||||
|
|
||||||
if (tileJSONFormat === 'pbf') {
|
|
||||||
if (options.dataDecoratorFunc) {
|
|
||||||
if (isGzipped) {
|
if (isGzipped) {
|
||||||
data = await gunzipP(data);
|
data = await gunzipP(data);
|
||||||
isGzipped = false;
|
isGzipped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tileJSONFormat === 'pbf') {
|
||||||
|
if (options.dataDecoratorFunc) {
|
||||||
data = options.dataDecoratorFunc(
|
data = options.dataDecoratorFunc(
|
||||||
req.params.id,
|
req.params.id,
|
||||||
'data',
|
'data',
|
||||||
|
|
Loading…
Reference in a new issue