fix t-coord tiles processing
This commit is contained in:
@@ -3,5 +3,6 @@
|
||||
!public
|
||||
!test
|
||||
!package.json
|
||||
!mapbox-mbtiles-0.12.2.tgz
|
||||
!package-lock.json
|
||||
!docker-entrypoint.sh
|
||||
|
||||
@@ -44,6 +44,7 @@ RUN mkdir -p /usr/src/app
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY mapbox-mbtiles-0.12.2.tgz /usr/src/app
|
||||
COPY package.json /usr/src/app
|
||||
COPY package-lock.json /usr/src/app
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ export const serve_data = {
|
||||
},
|
||||
);
|
||||
|
||||
app.get('/:id/:t(\\d+)/:z(\\ d+)/:x(\\d+)/:y(\\d+).:format([\\w.]+)', (req, res, next) => {
|
||||
app.get('/:id/:t(\\d+)/:z(\\d+)/:x(\\d+)/:y(\\d+).:format([\\w.]+)', (req, res, next) => {
|
||||
const item = repo[req.params.id];
|
||||
if (!item) {
|
||||
return res.sendStatus(404);
|
||||
@@ -131,7 +131,7 @@ export const serve_data = {
|
||||
format = 'pbf';
|
||||
}
|
||||
if (format !== tileJSONFormat &&
|
||||
!(format === 'geojson' && tileJSONFormat === 'pbf')) {
|
||||
!(format === 'geojson' && tileJSONFormat === 'pbf') && format !== 'png') {
|
||||
return res.status(404).send('Invalid format');
|
||||
}
|
||||
if (z < item.tileJSON.minzoom || 0 || x < 0 || y < 0 ||
|
||||
@@ -165,6 +165,8 @@ export const serve_data = {
|
||||
}
|
||||
if (format === 'pbf') {
|
||||
headers['Content-Type'] = 'application/x-protobuf';
|
||||
} else if (format === 'png') {
|
||||
headers['Content-Type'] = 'image/png';
|
||||
} else if (format === 'geojson') {
|
||||
headers['Content-Type'] = 'application/json';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user