forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
99edba4c73
12 changed files with 129 additions and 72 deletions
|
@ -376,9 +376,29 @@ async function main(args: string[]) {
|
|||
const lat1 = Number(args[5])
|
||||
const lon1 = Number(args[6])
|
||||
|
||||
if(isNaN(lat0)){
|
||||
throw "The first number (a latitude) is not a valid number"
|
||||
}
|
||||
|
||||
if(isNaN(lon0)){
|
||||
throw "The second number (a longitude) is not a valid number"
|
||||
}
|
||||
if(isNaN(lat1)){
|
||||
throw "The third number (a latitude) is not a valid number"
|
||||
}
|
||||
|
||||
if(isNaN(lon1)){
|
||||
throw "The first number (a longitude) is not a valid number"
|
||||
}
|
||||
|
||||
|
||||
|
||||
const tileRange = Tiles.TileRangeBetween(zoomlevel, lat0, lon0, lat1, lon1)
|
||||
|
||||
if(isNaN(tileRange.total)){
|
||||
throw "Something has gone wrong: tilerange is NAN"
|
||||
}
|
||||
|
||||
if (tileRange.total === 0) {
|
||||
console.log("Tilerange has zero tiles - this is probably an error")
|
||||
return
|
||||
|
@ -440,8 +460,9 @@ async function main(args: string[]) {
|
|||
let args = [...process.argv]
|
||||
args.splice(0, 2)
|
||||
try {
|
||||
main(args).catch(e => console.error("Error building cache:", e));
|
||||
main(args)
|
||||
.then(() => console.log("All done!"))
|
||||
.catch(e => console.error("Error building cache:", e));
|
||||
} catch (e) {
|
||||
console.error("Error building cache:", e)
|
||||
}
|
||||
console.log("All done!")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue