chore: remove duplicated field names to simplify code
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
This commit is contained in:
parent
d9c2128ddf
commit
f69a2339b8
3 changed files with 21 additions and 21 deletions
|
@ -68,8 +68,8 @@ const StartServer = (configPath, config) => {
|
||||||
publicUrl += '/';
|
publicUrl += '/';
|
||||||
}
|
}
|
||||||
return server({
|
return server({
|
||||||
configPath: configPath,
|
configPath,
|
||||||
config: config,
|
config,
|
||||||
bind: opts.bind,
|
bind: opts.bind,
|
||||||
port: opts.port,
|
port: opts.port,
|
||||||
cors: opts.cors,
|
cors: opts.cors,
|
||||||
|
@ -77,7 +77,7 @@ const StartServer = (configPath, config) => {
|
||||||
silent: opts.silent,
|
silent: opts.silent,
|
||||||
logFile: opts.log_file,
|
logFile: opts.log_file,
|
||||||
logFormat: opts.log_format,
|
logFormat: opts.log_format,
|
||||||
publicUrl: publicUrl,
|
publicUrl,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ const StartWithInputFile = async (inputFile) => {
|
||||||
config['styles'][styleName] = {
|
config['styles'][styleName] = {
|
||||||
style: styleFileRel,
|
style: styleFileRel,
|
||||||
tilejson: {
|
tilejson: {
|
||||||
bounds: bounds,
|
bounds,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ function createEmptyResponse(format, color, callback) {
|
||||||
raw: {
|
raw: {
|
||||||
width: 1,
|
width: 1,
|
||||||
height: 1,
|
height: 1,
|
||||||
channels: channels,
|
channels,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.toFormat(format)
|
.toFormat(format)
|
||||||
|
@ -405,10 +405,10 @@ const respondImage = (
|
||||||
const params = {
|
const params = {
|
||||||
zoom: mlglZ,
|
zoom: mlglZ,
|
||||||
center: [lon, lat],
|
center: [lon, lat],
|
||||||
bearing: bearing,
|
bearing,
|
||||||
pitch: pitch,
|
pitch,
|
||||||
width: width,
|
width,
|
||||||
height: height,
|
height,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (z === 0) {
|
if (z === 0) {
|
||||||
|
@ -856,8 +856,8 @@ export const serve_rendered = {
|
||||||
const createPool = (ratio, mode, min, max) => {
|
const createPool = (ratio, mode, min, max) => {
|
||||||
const createRenderer = (ratio, createCallback) => {
|
const createRenderer = (ratio, createCallback) => {
|
||||||
const renderer = new mlgl.Map({
|
const renderer = new mlgl.Map({
|
||||||
mode: mode,
|
mode,
|
||||||
ratio: ratio,
|
ratio,
|
||||||
request: async (req, callback) => {
|
request: async (req, callback) => {
|
||||||
const protocol = req.url.split(':')[0];
|
const protocol = req.url.split(':')[0];
|
||||||
// console.log('Handling request:', req);
|
// console.log('Handling request:', req);
|
||||||
|
@ -1016,8 +1016,8 @@ export const serve_rendered = {
|
||||||
createCallback(null, renderer);
|
createCallback(null, renderer);
|
||||||
};
|
};
|
||||||
return new advancedPool.Pool({
|
return new advancedPool.Pool({
|
||||||
min: min,
|
min,
|
||||||
max: max,
|
max,
|
||||||
create: createRenderer.bind(null, ratio),
|
create: createRenderer.bind(null, ratio),
|
||||||
destroy: (renderer) => {
|
destroy: (renderer) => {
|
||||||
renderer.release();
|
renderer.release();
|
||||||
|
@ -1114,9 +1114,9 @@ export const serve_rendered = {
|
||||||
|
|
||||||
let inputFile;
|
let inputFile;
|
||||||
const DataInfo = dataResolver(dataId);
|
const DataInfo = dataResolver(dataId);
|
||||||
if (DataInfo.inputfile) {
|
if (DataInfo.inputFile) {
|
||||||
inputFile = DataInfo.inputfile;
|
inputFile = DataInfo.inputFile;
|
||||||
source_type = DataInfo.filetype;
|
source_type = DataInfo.fileType;
|
||||||
} else {
|
} else {
|
||||||
console.error(`ERROR: data "${inputFile}" not found!`);
|
console.error(`ERROR: data "${inputFile}" not found!`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
@ -253,7 +253,7 @@ function start(opts) {
|
||||||
inputFile = path.resolve(options.paths[fileType], inputFile);
|
inputFile = path.resolve(options.paths[fileType], inputFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { inputfile: inputFile, filetype: fileType };
|
return { inputFile, fileType };
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -344,7 +344,7 @@ function start(opts) {
|
||||||
result.push({
|
result.push({
|
||||||
version: styleJSON.version,
|
version: styleJSON.version,
|
||||||
name: styleJSON.name,
|
name: styleJSON.name,
|
||||||
id: id,
|
id,
|
||||||
url: `${getPublicUrl(
|
url: `${getPublicUrl(
|
||||||
opts.publicUrl,
|
opts.publicUrl,
|
||||||
req,
|
req,
|
||||||
|
@ -630,9 +630,9 @@ function start(opts) {
|
||||||
enableShutdown(server);
|
enableShutdown(server);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
app: app,
|
app,
|
||||||
server: server,
|
server,
|
||||||
startupPromise: startupPromise,
|
startupPromise,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue