Merge master

This commit is contained in:
pietervdvn 2021-01-04 16:09:12 +01:00
commit da7d1287f0
2 changed files with 53 additions and 65 deletions

View file

@ -7,10 +7,9 @@ import CountryCoder from "latlon2country"
import {UIEventSource} from "./UIEventSource"; import {UIEventSource} from "./UIEventSource";
class SimpleMetaTagger { class SimpleMetaTagger {
private _f: (feature: any, index: number) => void;
public readonly keys: string[]; public readonly keys: string[];
public readonly doc: string; public readonly doc: string;
private _f: (feature: any, index: number) => void;
constructor(keys: string[], doc: string, f: ((feature: any, index: number) => void)) { constructor(keys: string[], doc: string, f: ((feature: any, index: number) => void)) {
this.keys = keys; this.keys = keys;
@ -90,7 +89,7 @@ export default class MetaTagging {
if (tags.opening_hours === undefined || tags._country === undefined) { if (tags.opening_hours === undefined || tags._country === undefined) {
return; return;
} }
try{ try {
const oh = new opening_hours(tags["opening_hours"], { const oh = new opening_hours(tags["opening_hours"], {
lat: tags._lat, lat: tags._lat,
@ -121,8 +120,8 @@ export default class MetaTagging {
} }
} }
updateTags(); updateTags();
}catch(e){ } catch (e) {
console.error(e); console.error("Error while parsing opening hours of ", tags.id, e);
tags["_isOpen"] = "parse_error"; tags["_isOpen"] = "parse_error";
} }
@ -251,16 +250,16 @@ export default class MetaTagging {
carWidthUsed + carWidthUsed +
cyclistWidthUsed + cyclistWidthUsed +
parallelParkingCount * carWidthUsed; parallelParkingCount * carWidthUsed;
properties["_width:needed:no_pedestrians"] =Utils.Round(targetWidthIgnoringPedestrians); properties["_width:needed:no_pedestrians"] = Utils.Round(targetWidthIgnoringPedestrians);
const pedestriansNeed = Math.max(0, pedestrianFlowNeeded) * pedestrianWidth; const pedestriansNeed = Math.max(0, pedestrianFlowNeeded) * pedestrianWidth;
const targetWidth = targetWidthIgnoringPedestrians + pedestriansNeed ; const targetWidth = targetWidthIgnoringPedestrians + pedestriansNeed;
properties["_width:needed"] = Utils.Round(targetWidth); properties["_width:needed"] = Utils.Round(targetWidth);
properties["_width:needed:pedestrians"] = Utils.Round(pedestriansNeed) properties["_width:needed:pedestrians"] = Utils.Round(pedestriansNeed)
properties["_width:difference"] = Utils.Round(targetWidth - width ); properties["_width:difference"] = Utils.Round(targetWidth - width);
properties["_width:difference:no_pedestrians"] = Utils.Round(targetWidthIgnoringPedestrians - width) ; properties["_width:difference:no_pedestrians"] = Utils.Round(targetWidthIgnoringPedestrians - width);
} }
); );

View file

@ -7,7 +7,15 @@
"de": "Mit Fahrrad zusammenhängendes Objekt" "de": "Mit Fahrrad zusammenhängendes Objekt"
}, },
"minzoom": 13, "minzoom": 13,
"overpassTags": {"or": ["theme~cycling|bicycle", "sport=cycling"]}, "overpassTags": {
"or": [
"theme~cycling|bicycle",
"sport=cycling",
"association~cycling|bicycle",
"ngo~cycling|bicycle",
"club~bicycle|cycling"
]
},
"title": { "title": {
"render": { "render": {
"en": "Bike related object", "en": "Bike related object",
@ -18,7 +26,7 @@
"mappings": [ "mappings": [
{ {
"if": "name~*", "if": "name~*",
"then":"<i>{name}</i>" "then": "<i>{name}</i>"
}, },
{ {
"if": "leisure=track", "if": "leisure=track",
@ -30,32 +38,13 @@
] ]
}, },
"description": {}, "description": {},
"tagRenderings": [ "images", "tagRenderings": [
"images",
{ "description",
"render": "<a href='{website}' target='_blank'>{website}</a>", "website",
"freeform": { "email",
"key": "website" "phone",
} "opening_hours"
},
{
"render": "<a href='tel:{phone}'>{phone}</a>",
"freeform": {
"key": "phone"
}
},
{
"render": "<a href='mailto:{email}' target='_blank'>{email}</a>",
"freeform": {
"key": "email"
}
},
{
"render": "{opening_hours_table(opening_hours)}",
"freeform": {
"key": "opening_hours"
}
}
], ],
"hideUnderlayingFeaturesMinPercentage": 0, "hideUnderlayingFeaturesMinPercentage": 0,
"icon": { "icon": {