Include route=foot in trails
This commit is contained in:
parent
b61c0a1180
commit
791c6c4f55
5 changed files with 34 additions and 8 deletions
|
@ -82,7 +82,7 @@ export default class FilteringFeatureSource implements FeatureSourceForLayer, Ti
|
|||
}
|
||||
}
|
||||
|
||||
const tagsFilter = Array.from(layer.appliedFilters.data.values());
|
||||
const tagsFilter = Array.from(layer.appliedFilters?.data?.values() ?? []);
|
||||
for (const filter of tagsFilter ?? []) {
|
||||
const neededTags : TagsFilter = filter?.currentFilter
|
||||
if (neededTags !== undefined && !neededTags.matchesProperties(f.feature.properties)) {
|
||||
|
|
5
Utils.ts
5
Utils.ts
|
@ -495,7 +495,10 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
}
|
||||
const data = await Utils.download(url, Utils.Merge({"accept": "application/json"}, headers ?? {}))
|
||||
try {
|
||||
return JSON.parse(data)
|
||||
if(typeof data === "string"){
|
||||
return JSON.parse(data)
|
||||
}
|
||||
return data
|
||||
} catch (e) {
|
||||
console.error("Could not parse ", data, "due to", e, "\n", e.stack)
|
||||
throw e;
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
"and": [
|
||||
{
|
||||
"or": [
|
||||
"route=hiking",
|
||||
"route=bycicle",
|
||||
"route=horse"
|
||||
"route~.*foot.*",
|
||||
"route~.*hiking.*",
|
||||
"route~.*bycicle.*",
|
||||
"route~.*horse.*"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
"generate:cache:speelplekken:mini": "ts-node scripts/generateCache.ts speelplekken 14 ../MapComplete-data/speelplekken_cache_mini/ 51.181710380278176 4.423413276672363 51.193007664772495 4.444141387939452",
|
||||
"generate:cache:speelplekken": "npm run generate:layeroverview && ts-node scripts/generateCache.ts speelplekken 14 ../MapComplete-data/speelplekken_cache/ 51.20 4.35 51.09 4.56",
|
||||
"generate:cache:natuurpunt": "npm run generate:layeroverview && ts-node scripts/generateCache.ts natuurpunt 12 ../MapComplete-data/natuurpunt_cache/ 50.40 2.1 51.54 6.4 --generate-point-overview nature_reserve,visitor_information_centre",
|
||||
"generate:cache:natuurpunt:mini": "ts-node scripts/generateCache.ts natuurpunt 12 ../../git/MapComplete-data/natuurpunt_cache_mini/ 51.00792239979105 4.497699737548828 51.0353492224462554 4.539070129394531 --generate-point-overview nature_reserve,visitor_information_centre",
|
||||
"generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail",
|
||||
"generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail",
|
||||
"query:licenses": "ts-node scripts/generateLicenseInfo.ts --query",
|
||||
|
|
|
@ -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…
Reference in a new issue