fix: http pmtiles not working in style
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
49d49e697e
commit
979f841464
1 changed files with 9 additions and 5 deletions
|
|
@ -19,7 +19,7 @@ import morgan from 'morgan';
|
||||||
import { serve_data } from './serve_data.js';
|
import { serve_data } from './serve_data.js';
|
||||||
import { serve_style } from './serve_style.js';
|
import { serve_style } from './serve_style.js';
|
||||||
import { serve_font } from './serve_font.js';
|
import { serve_font } from './serve_font.js';
|
||||||
import { getTileUrls, getPublicUrl } from './utils.js';
|
import { getTileUrls, getPublicUrl, isValidHttpUrl } from './utils.js';
|
||||||
|
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
|
@ -245,10 +245,14 @@ function start(opts) {
|
||||||
for (const id of Object.keys(data)) {
|
for (const id of Object.keys(data)) {
|
||||||
if (id === fileid) {
|
if (id === fileid) {
|
||||||
if (data[id].pmtiles !== undefined) {
|
if (data[id].pmtiles !== undefined) {
|
||||||
inputFile = path.resolve(
|
if (isValidHttpUrl(data[id].pmtiles)) {
|
||||||
options.paths.pmtiles,
|
inputFile = data[id].pmtiles;
|
||||||
data[id].pmtiles,
|
} else {
|
||||||
);
|
inputFile = path.resolve(
|
||||||
|
options.paths.pmtiles,
|
||||||
|
data[id].pmtiles,
|
||||||
|
);
|
||||||
|
}
|
||||||
fileType = 'pmtiles';
|
fileType = 'pmtiles';
|
||||||
} else if (data[id].mbtiles !== undefined) {
|
} else if (data[id].mbtiles !== undefined) {
|
||||||
inputFile = path.resolve(
|
inputFile = path.resolve(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue