Merge master
|
@ -21,6 +21,7 @@
|
|||
+ [bicycle_rental.*bicycle_rental](#bicycle_rental*bicycle_rental)
|
||||
+ [bike_cleaning.bike_cleaning-service:bicycle:cleaning:charge](#bike_cleaningbike_cleaning-service:bicycle:cleaning:charge)
|
||||
+ [wheelchair-access](#wheelchair-access)
|
||||
+ [smoking](#smoking)
|
||||
+ [service:electricity](#serviceelectricity)
|
||||
+ [dog-access](#dog-access)
|
||||
+ [climbing.website](#climbingwebsite)
|
||||
|
@ -287,6 +288,17 @@
|
|||
|
||||
|
||||
|
||||
### smoking
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- cafe_pub
|
||||
|
||||
|
||||
|
||||
|
||||
### service:electricity
|
||||
|
||||
|
||||
|
|
|
@ -33,11 +33,13 @@ The following items can be easily reused in your layers
|
|||
+ [last_edit](#last_edit)
|
||||
+ [all_tags](#all_tags)
|
||||
+ [level](#level)
|
||||
+ [smoking](#smoking)
|
||||
+ [default](#default)
|
||||
+ [defaults](#defaults)
|
||||
+ [isOpen](#isopen)
|
||||
+ [phonelink](#phonelink)
|
||||
+ [emaillink](#emaillink)
|
||||
+ [smokingicon](#smokingicon)
|
||||
+ [sharelink](#sharelink)
|
||||
|
||||
|
||||
|
@ -341,6 +343,21 @@ On what level is this feature located?
|
|||
|
||||
|
||||
|
||||
### smoking
|
||||
|
||||
|
||||
|
||||
Is smoking allowed at {title()}?
|
||||
|
||||
|
||||
|
||||
- Smoking is <b>allowed</b>
|
||||
- Smoking is <b>not allowed</b>
|
||||
- Smoking is <b>allowed outside</b>.
|
||||
|
||||
|
||||
|
||||
|
||||
### default
|
||||
|
||||
|
||||
|
@ -377,7 +394,7 @@ Read-only tagrendering
|
|||
|
||||
|
||||
|
||||
<a href='tel:{phone}'><img textmode='📞' alt='phone' src='./assets/svg/phone.svg'/></a>
|
||||
<a href='tel:{phone}'><img textmode='📞' alt='phone' src='./assets/tagRenderings/phone.svg'/></a>
|
||||
|
||||
Read-only tagrendering
|
||||
|
||||
|
@ -387,12 +404,26 @@ Read-only tagrendering
|
|||
|
||||
|
||||
|
||||
<a href='mailto:{email}'><img textmode='✉️' alt='email' src='./assets/svg/send_email.svg'/></a>
|
||||
<a href='mailto:{email}'><img textmode='✉️' alt='email' src='./assets/tagRenderings/send_email.svg'/></a>
|
||||
|
||||
Read-only tagrendering
|
||||
|
||||
|
||||
|
||||
### smokingicon
|
||||
|
||||
|
||||
|
||||
Read-only tagrendering
|
||||
|
||||
|
||||
|
||||
- <img textmode='🚭️' alt='no-smoking' src='./assets/tagRenderings/no_smoking.svg'/>
|
||||
- <img textmode='🚬️' alt='smoking-allowed' src='./assets/tagRenderings/smoking.svg'/>
|
||||
|
||||
|
||||
|
||||
|
||||
### sharelink
|
||||
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@ Elements must have the all of following tags to be shown on this layer:
|
|||
|
||||
|
||||
|
||||
- <a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbar' target='_blank'>bar</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dpub' target='_blank'>pub</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dcafe' target='_blank'>cafe</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbiergarten' target='_blank'>biergarten</a>
|
||||
- <a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbar' target='_blank'>bar</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dpub' target='_blank'>pub</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dcafe' target='_blank'>cafe</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbiergarten' target='_blank'>biergarten</a>|<a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dnightclub' target='_blank'>nightclub</a>
|
||||
|
||||
|
||||
[Execute on overpass](http://overpass-turbo.eu/?Q=%5Bout%3Ajson%5D%5Btimeout%3A90%5D%3B(%20%20%20%20nwr%5B%22amenity%22%3D%22bar%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22pub%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22cafe%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22biergarten%22%5D(%7B%7Bbbox%7D%7D)%3B%0A)%3Bout%20body%3B%3E%3Bout%20skel%20qt%3B)
|
||||
[Execute on overpass](http://overpass-turbo.eu/?Q=%5Bout%3Ajson%5D%5Btimeout%3A90%5D%3B(%20%20%20%20nwr%5B%22amenity%22%3D%22bar%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22pub%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22cafe%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22biergarten%22%5D(%7B%7Bbbox%7D%7D)%3B%0A%20%20%20%20nwr%5B%22amenity%22%3D%22nightclub%22%5D(%7B%7Bbbox%7D%7D)%3B%0A)%3Bout%20body%3B%3E%3Bout%20skel%20qt%3B)
|
||||
|
||||
|
||||
|
||||
|
@ -61,12 +61,13 @@ this quick overview is incomplete
|
|||
attribute | type | values which are supported by this layer
|
||||
----------- | ------ | ------------------------------------------
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/name#values) [name](https://wiki.openstreetmap.org/wiki/Key:name) | [string](../SpecialInputElements.md#string) |
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/amenity#values) [amenity](https://wiki.openstreetmap.org/wiki/Key:amenity) | Multiple choice | [pub](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dpub) [bar](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbar) [cafe](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dcafe) [restaurant](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Drestaurant) [biergarten](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbiergarten)
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/amenity#values) [amenity](https://wiki.openstreetmap.org/wiki/Key:amenity) | Multiple choice | [pub](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dpub) [bar](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbar) [cafe](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dcafe) [restaurant](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Drestaurant) [biergarten](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbiergarten) [nightclub](https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dnightclub)
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/opening_hours#values) [opening_hours](https://wiki.openstreetmap.org/wiki/Key:opening_hours) | [opening_hours](../SpecialInputElements.md#opening_hours) |
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/website#values) [website](https://wiki.openstreetmap.org/wiki/Key:website) | [url](../SpecialInputElements.md#url) |
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/email#values) [email](https://wiki.openstreetmap.org/wiki/Key:email) | [email](../SpecialInputElements.md#email) |
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/phone#values) [phone](https://wiki.openstreetmap.org/wiki/Key:phone) | [phone](../SpecialInputElements.md#phone) |
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/wheelchair#values) [wheelchair](https://wiki.openstreetmap.org/wiki/Key:wheelchair) | Multiple choice | [designated](https://wiki.openstreetmap.org/wiki/Tag:wheelchair%3Ddesignated) [yes](https://wiki.openstreetmap.org/wiki/Tag:wheelchair%3Dyes) [limited](https://wiki.openstreetmap.org/wiki/Tag:wheelchair%3Dlimited) [no](https://wiki.openstreetmap.org/wiki/Tag:wheelchair%3Dno)
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/smoking#values) [smoking](https://wiki.openstreetmap.org/wiki/Key:smoking) | Multiple choice | [yes](https://wiki.openstreetmap.org/wiki/Tag:smoking%3Dyes) [no](https://wiki.openstreetmap.org/wiki/Tag:smoking%3Dno) [outside](https://wiki.openstreetmap.org/wiki/Tag:smoking%3Doutside)
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/service:electricity#values) [service:electricity](https://wiki.openstreetmap.org/wiki/Key:service:electricity) | Multiple choice | [yes](https://wiki.openstreetmap.org/wiki/Tag:service:electricity%3Dyes) [limited](https://wiki.openstreetmap.org/wiki/Tag:service:electricity%3Dlimited) [ask](https://wiki.openstreetmap.org/wiki/Tag:service:electricity%3Dask) [no](https://wiki.openstreetmap.org/wiki/Tag:service:electricity%3Dno)
|
||||
[<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>](https://taginfo.openstreetmap.org/keys/dog#values) [dog](https://wiki.openstreetmap.org/wiki/Key:dog) | Multiple choice | [yes](https://wiki.openstreetmap.org/wiki/Tag:dog%3Dyes) [no](https://wiki.openstreetmap.org/wiki/Tag:dog%3Dno) [leashed](https://wiki.openstreetmap.org/wiki/Tag:dog%3Dleashed) [unleashed](https://wiki.openstreetmap.org/wiki/Tag:dog%3Dunleashed)
|
||||
|
||||
|
@ -112,6 +113,7 @@ The question is What kind of cafe is this?
|
|||
- A <b>cafe</b> to drink tea, coffee or an alcoholical bevarage in a quiet environment corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dcafe' target='_blank'>cafe</a>
|
||||
- A <b>restuarant</b> where one can get a proper meal corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Drestaurant' target='_blank'>restaurant</a>
|
||||
- An open space where beer is served, typically seen in Germany corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dbiergarten' target='_blank'>biergarten</a>
|
||||
- This is a <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:amenity' target='_blank'>amenity</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dnightclub' target='_blank'>nightclub</a>
|
||||
|
||||
|
||||
|
||||
|
@ -226,6 +228,23 @@ The question is Is this place accessible with a wheelchair?
|
|||
|
||||
|
||||
|
||||
### smoking
|
||||
|
||||
|
||||
|
||||
The question is Is smoking allowed at {title()}?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- Smoking is <b>allowed</b> corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:smoking' target='_blank'>smoking</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:smoking%3Dyes' target='_blank'>yes</a>
|
||||
- Smoking is <b>not allowed</b> corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:smoking' target='_blank'>smoking</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:smoking%3Dno' target='_blank'>no</a>
|
||||
- Smoking is <b>allowed outside</b>. corresponds with <a href='https://wiki.openstreetmap.org/wiki/Key:smoking' target='_blank'>smoking</a>=<a href='https://wiki.openstreetmap.org/wiki/Tag:smoking%3Doutside' target='_blank'>outside</a>
|
||||
|
||||
|
||||
|
||||
|
||||
### service:electricity
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
"description": "The MapComplete theme Cafés and pubs has a layer Cafés and pubs showing features with this tag",
|
||||
"value": "biergarten"
|
||||
},
|
||||
{
|
||||
"key": "amenity",
|
||||
"description": "The MapComplete theme Cafés and pubs has a layer Cafés and pubs showing features with this tag",
|
||||
"value": "nightclub"
|
||||
},
|
||||
{
|
||||
"key": "image",
|
||||
"description": "The layer 'Cafés and pubs allows to upload images and adds them under the 'image'-tag (and image:0, image:1, ... for multiple images). Furhtermore, this layer shows images based on the keys image, wikidata, wikipedia, wikimedia_commons and mapillary"
|
||||
|
@ -75,6 +80,11 @@
|
|||
"description": "Layer 'Cafés and pubs' shows amenity=biergarten with a fixed text, namely 'An open space where beer is served, typically seen in Germany' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
"value": "biergarten"
|
||||
},
|
||||
{
|
||||
"key": "amenity",
|
||||
"description": "Layer 'Cafés and pubs' shows amenity=nightclub with a fixed text, namely 'This is a <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
"value": "nightclub"
|
||||
},
|
||||
{
|
||||
"key": "opening_hours",
|
||||
"description": "Layer 'Cafés and pubs' shows and asks freeform values for key 'opening_hours' (in the MapComplete.osm.be theme 'Cafés and pubs')"
|
||||
|
@ -133,6 +143,21 @@
|
|||
"description": "Layer 'Cafés and pubs' shows wheelchair=no with a fixed text, namely 'This place is not reachable with a wheelchair' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
"value": "no"
|
||||
},
|
||||
{
|
||||
"key": "smoking",
|
||||
"description": "Layer 'Cafés and pubs' shows smoking=yes with a fixed text, namely 'Smoking is <b>allowed</b>' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
"value": "yes"
|
||||
},
|
||||
{
|
||||
"key": "smoking",
|
||||
"description": "Layer 'Cafés and pubs' shows smoking=no with a fixed text, namely 'Smoking is <b>not allowed</b>' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
"value": "no"
|
||||
},
|
||||
{
|
||||
"key": "smoking",
|
||||
"description": "Layer 'Cafés and pubs' shows smoking=outside with a fixed text, namely 'Smoking is <b>allowed outside</b>.' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
"value": "outside"
|
||||
},
|
||||
{
|
||||
"key": "service:electricity",
|
||||
"description": "Layer 'Cafés and pubs' shows service:electricity=yes with a fixed text, namely 'There are plenty of domestic sockets available to customers seated indoors, where they can charge their electronics' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Cafés and pubs')",
|
||||
|
|
|
@ -1920,6 +1920,11 @@
|
|||
"description": "The MapComplete theme Personal theme has a layer Cafés and pubs showing features with this tag",
|
||||
"value": "biergarten"
|
||||
},
|
||||
{
|
||||
"key": "amenity",
|
||||
"description": "The MapComplete theme Personal theme has a layer Cafés and pubs showing features with this tag",
|
||||
"value": "nightclub"
|
||||
},
|
||||
{
|
||||
"key": "image",
|
||||
"description": "The layer 'Cafés and pubs allows to upload images and adds them under the 'image'-tag (and image:0, image:1, ... for multiple images). Furhtermore, this layer shows images based on the keys image, wikidata, wikipedia, wikimedia_commons and mapillary"
|
||||
|
@ -1965,6 +1970,11 @@
|
|||
"description": "Layer 'Cafés and pubs' shows amenity=biergarten with a fixed text, namely 'An open space where beer is served, typically seen in Germany' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
"value": "biergarten"
|
||||
},
|
||||
{
|
||||
"key": "amenity",
|
||||
"description": "Layer 'Cafés and pubs' shows amenity=nightclub with a fixed text, namely 'This is a <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
"value": "nightclub"
|
||||
},
|
||||
{
|
||||
"key": "opening_hours",
|
||||
"description": "Layer 'Cafés and pubs' shows and asks freeform values for key 'opening_hours' (in the MapComplete.osm.be theme 'Personal theme')"
|
||||
|
@ -2023,6 +2033,21 @@
|
|||
"description": "Layer 'Cafés and pubs' shows wheelchair=no with a fixed text, namely 'This place is not reachable with a wheelchair' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
"value": "no"
|
||||
},
|
||||
{
|
||||
"key": "smoking",
|
||||
"description": "Layer 'Cafés and pubs' shows smoking=yes with a fixed text, namely 'Smoking is <b>allowed</b>' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
"value": "yes"
|
||||
},
|
||||
{
|
||||
"key": "smoking",
|
||||
"description": "Layer 'Cafés and pubs' shows smoking=no with a fixed text, namely 'Smoking is <b>not allowed</b>' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
"value": "no"
|
||||
},
|
||||
{
|
||||
"key": "smoking",
|
||||
"description": "Layer 'Cafés and pubs' shows smoking=outside with a fixed text, namely 'Smoking is <b>allowed outside</b>.' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
"value": "outside"
|
||||
},
|
||||
{
|
||||
"key": "service:electricity",
|
||||
"description": "Layer 'Cafés and pubs' shows service:electricity=yes with a fixed text, namely 'There are plenty of domestic sockets available to customers seated indoors, where they can charge their electronics' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Personal theme')",
|
||||
|
|
|
@ -18,10 +18,12 @@ export class UpdateLegacyLayer extends DesugaringStep<LayerConfigJson | string |
|
|||
// Reuse of an already existing layer; return as-is
|
||||
return {result: json, errors: [], warnings: []}
|
||||
}
|
||||
let config: any = {...json};
|
||||
let config = {...json};
|
||||
|
||||
if (config["overpassTags"]) {
|
||||
config.source = config.source ?? {}
|
||||
config.source = config.source ?? {
|
||||
osmTags: config["overpassTags"]
|
||||
}
|
||||
config.source.osmTags = config["overpassTags"]
|
||||
delete config["overpassTags"]
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
|
|||
}
|
||||
if (image.match(/[a-z]*/)) {
|
||||
|
||||
if(Svg.All[image + ".svg"] !== undefined){
|
||||
if (Svg.All[image + ".svg"] !== undefined) {
|
||||
// This is a builtin img, e.g. 'checkmark' or 'crosshair'
|
||||
continue;// =>
|
||||
}
|
||||
|
@ -124,12 +124,12 @@ class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
|
|||
|
||||
const w = parseInt(width);
|
||||
const h = parseInt(height)
|
||||
if(w < 370 || h < 370){
|
||||
const e : string = [
|
||||
if (w < 370 || h < 370) {
|
||||
const e: string = [
|
||||
`the icon for theme ${json.id} is too small. Please rescale the icon at ${json.icon}`,
|
||||
`Even though an SVG is 'infinitely scaleable', the icon should be dimensioned bigger. One of the build steps of the theme does convert the image to a PNG (to serve as PWA-icon) and having a small dimension will cause blurry images.`,
|
||||
` Width = ${width} height = ${height}; we recommend a size of at least 500px * 500px and to use a square aspect ratio.`,
|
||||
].join("\n");
|
||||
].join("\n");
|
||||
(json.hideFromOverview ? warnings : errors).push(e)
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ export class ValidateThemeAndLayers extends Fuse<LayoutConfigJson> {
|
|||
constructor(knownImagePaths: Set<string>, path: string, isBuiltin: boolean, sharedTagRenderings: Map<string, any>) {
|
||||
super("Validates a theme and the contained layers",
|
||||
new ValidateTheme(knownImagePaths, path, isBuiltin, sharedTagRenderings),
|
||||
new On("layers", new Each(new ValidateLayer(undefined, false)))
|
||||
new On("layers", new Each(new ValidateLayer(undefined, false, knownImagePaths)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -222,22 +222,22 @@ class OverrideShadowingCheck extends DesugaringStep<LayoutConfigJson> {
|
|||
|
||||
}
|
||||
|
||||
class MiscThemeChecks extends DesugaringStep<LayoutConfigJson>{
|
||||
class MiscThemeChecks extends DesugaringStep<LayoutConfigJson> {
|
||||
constructor() {
|
||||
super("Miscelleanous checks on the theme", [],"MiscThemesChecks");
|
||||
super("Miscelleanous checks on the theme", [], "MiscThemesChecks");
|
||||
}
|
||||
|
||||
convert(json: LayoutConfigJson, context: string): { result: LayoutConfigJson; errors?: string[]; warnings?: string[]; information?: string[] } {
|
||||
const warnings = []
|
||||
const errors = []
|
||||
if(json.id !== "personal" && (json.layers === undefined || json.layers.length === 0)){
|
||||
errors.push("The theme "+json.id+" has no 'layers' defined ("+context+")")
|
||||
if (json.id !== "personal" && (json.layers === undefined || json.layers.length === 0)) {
|
||||
errors.push("The theme " + json.id + " has no 'layers' defined (" + context + ")")
|
||||
}
|
||||
if(json.socialImage === ""){
|
||||
warnings.push("Social image for theme "+json.id+" is the emtpy string")
|
||||
if (json.socialImage === "") {
|
||||
warnings.push("Social image for theme " + json.id + " is the emtpy string")
|
||||
}
|
||||
return {
|
||||
result :json,
|
||||
result: json,
|
||||
warnings,
|
||||
errors
|
||||
};
|
||||
|
@ -258,6 +258,7 @@ export class PrevalidateTheme extends Fuse<LayoutConfigJson> {
|
|||
|
||||
export class DetectShadowedMappings extends DesugaringStep<QuestionableTagRenderingConfigJson> {
|
||||
private readonly _calculatedTagNames: string[];
|
||||
|
||||
constructor(layerConfig?: LayerConfigJson) {
|
||||
super("Checks that the mappings don't shadow each other", [], "DetectShadowedMappings");
|
||||
this._calculatedTagNames = DetectShadowedMappings.extractCalculatedTagNames(layerConfig);
|
||||
|
@ -268,9 +269,9 @@ export class DetectShadowedMappings extends DesugaringStep<QuestionableTagRender
|
|||
* DetectShadowedMappings.extractCalculatedTagNames({calculatedTags: ["_abc:=js()"]}) // => ["_abc"]
|
||||
* DetectShadowedMappings.extractCalculatedTagNames({calculatedTags: ["_abc=js()"]}) // => ["_abc"]
|
||||
*/
|
||||
private static extractCalculatedTagNames(layerConfig?: LayerConfigJson | {calculatedTags : string []}){
|
||||
private static extractCalculatedTagNames(layerConfig?: LayerConfigJson | { calculatedTags: string [] }) {
|
||||
return layerConfig?.calculatedTags?.map(ct => {
|
||||
if(ct.indexOf(':=') >= 0){
|
||||
if (ct.indexOf(':=') >= 0) {
|
||||
return ct.split(':=')[0]
|
||||
}
|
||||
return ct.split("=")[0]
|
||||
|
@ -319,20 +320,20 @@ export class DetectShadowedMappings extends DesugaringStep<QuestionableTagRender
|
|||
}
|
||||
const defaultProperties = {}
|
||||
for (const calculatedTagName of this._calculatedTagNames) {
|
||||
defaultProperties[calculatedTagName] = "some_calculated_tag_value_for_"+calculatedTagName
|
||||
defaultProperties[calculatedTagName] = "some_calculated_tag_value_for_" + calculatedTagName
|
||||
}
|
||||
const parsedConditions = json.mappings.map((m,i) => {
|
||||
const parsedConditions = json.mappings.map((m, i) => {
|
||||
const ctx = `${context}.mappings[${i}]`
|
||||
const ifTags = TagUtils.Tag(m.if, ctx);
|
||||
if(m.hideInAnswer !== undefined && m.hideInAnswer !== false && m.hideInAnswer !== true){
|
||||
let conditionTags = TagUtils.Tag( m.hideInAnswer)
|
||||
if (m.hideInAnswer !== undefined && m.hideInAnswer !== false && m.hideInAnswer !== true) {
|
||||
let conditionTags = TagUtils.Tag(m.hideInAnswer)
|
||||
// Merge the condition too!
|
||||
return new And([conditionTags, ifTags])
|
||||
}
|
||||
return ifTags
|
||||
})
|
||||
for (let i = 0; i < json.mappings.length; i++) {
|
||||
if(!parsedConditions[i].isUsableAsAnswer()){
|
||||
if (!parsedConditions[i].isUsableAsAnswer()) {
|
||||
// There is no straightforward way to convert this mapping.if into a properties-object, so we simply skip this one
|
||||
// Yes, it might be shadowed, but running this check is to difficult right now
|
||||
continue
|
||||
|
@ -372,12 +373,14 @@ export class DetectShadowedMappings extends DesugaringStep<QuestionableTagRender
|
|||
}
|
||||
|
||||
export class DetectMappingsWithImages extends DesugaringStep<TagRenderingConfigJson> {
|
||||
constructor() {
|
||||
private knownImagePaths: Set<string>;
|
||||
constructor(knownImagePaths: Set<string>) {
|
||||
super("Checks that 'then'clauses in mappings don't have images, but use 'icon' instead", [], "DetectMappingsWithImages");
|
||||
this.knownImagePaths = knownImagePaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* const r = new DetectMappingsWithImages().convert({
|
||||
* const r = new DetectMappingsWithImages(new Set<string>()).convert({
|
||||
* "mappings": [
|
||||
* {
|
||||
* "if": "bicycle_parking=stands",
|
||||
|
@ -407,21 +410,29 @@ export class DetectMappingsWithImages extends DesugaringStep<TagRenderingConfigJ
|
|||
for (let i = 0; i < json.mappings.length; i++) {
|
||||
|
||||
const mapping = json.mappings[i]
|
||||
const ignore = mapping["#"]?.indexOf(ignoreToken) >=0
|
||||
const ignore = mapping["#"]?.indexOf(ignoreToken) >= 0
|
||||
const images = Utils.Dedup(Translations.T(mapping.then)?.ExtractImages() ?? [])
|
||||
const ctx = `${context}.mappings[${i}]`
|
||||
if (images.length > 0) {
|
||||
if(!ignore){
|
||||
if (!ignore) {
|
||||
errors.push(`${ctx}: A mapping has an image in the 'then'-clause. Remove the image there and use \`"icon": <your-image>\` instead. The images found are ${images.join(", ")}. (This check can be turned of by adding "#": "${ignoreToken}" in the mapping, but this is discouraged`)
|
||||
}else{
|
||||
} else {
|
||||
information.push(`${ctx}: Ignored image ${images.join(", ")} in 'then'-clause of a mapping as this check has been disabled`)
|
||||
|
||||
for (const image of images) {
|
||||
if (this.knownImagePaths !== undefined && !this.knownImagePaths.has(image)) {
|
||||
const ctx = context === undefined ? "" : ` in a layer defined in the theme ${context}`
|
||||
errors.push(`Image with path ${image} not found or not attributed; it is used in ${json.id}${ctx}`)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else if (ignore){
|
||||
} else if (ignore) {
|
||||
warnings.push(`${ctx}: unused '${ignoreToken}' - please remove this`)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
return {
|
||||
errors,
|
||||
warnings,
|
||||
information,
|
||||
|
@ -431,10 +442,10 @@ export class DetectMappingsWithImages extends DesugaringStep<TagRenderingConfigJ
|
|||
}
|
||||
|
||||
export class ValidateTagRenderings extends Fuse<TagRenderingConfigJson> {
|
||||
constructor(layerConfig: LayerConfigJson) {
|
||||
constructor(layerConfig?: LayerConfigJson, knownImagePaths?: Set<string>) {
|
||||
super("Various validation on tagRenderingConfigs",
|
||||
new DetectShadowedMappings( layerConfig),
|
||||
new DetectMappingsWithImages()
|
||||
new DetectShadowedMappings(layerConfig),
|
||||
new DetectMappingsWithImages(knownImagePaths)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -446,11 +457,13 @@ export class ValidateLayer extends DesugaringStep<LayerConfigJson> {
|
|||
*/
|
||||
private readonly _path?: string;
|
||||
private readonly _isBuiltin: boolean;
|
||||
private knownImagePaths: Set<string> | undefined;
|
||||
|
||||
constructor(path: string, isBuiltin: boolean) {
|
||||
constructor(path: string, isBuiltin: boolean, knownImagePaths: Set<string>) {
|
||||
super("Doesn't change anything, but emits warnings and errors", [], "ValidateLayer");
|
||||
this._path = path;
|
||||
this._isBuiltin = isBuiltin;
|
||||
this.knownImagePaths = knownImagePaths
|
||||
}
|
||||
|
||||
convert(json: LayerConfigJson, context: string): { result: LayerConfigJson; errors: string[]; warnings?: string[], information?: string[] } {
|
||||
|
@ -475,10 +488,10 @@ export class ValidateLayer extends DesugaringStep<LayerConfigJson> {
|
|||
|
||||
{
|
||||
// duplicate ids in tagrenderings check
|
||||
const duplicates = Utils.Dedup(Utils.Dupiclates( Utils.NoNull((json.tagRenderings ?? []).map(tr => tr["id"]))))
|
||||
.filter(dupl => dupl !== "questions")
|
||||
if(duplicates.length > 0){
|
||||
errors.push("At "+context+": some tagrenderings have a duplicate id: "+duplicates.join(", "))
|
||||
const duplicates = Utils.Dedup(Utils.Dupiclates(Utils.NoNull((json.tagRenderings ?? []).map(tr => tr["id"]))))
|
||||
.filter(dupl => dupl !== "questions")
|
||||
if (duplicates.length > 0) {
|
||||
errors.push("At " + context + ": some tagrenderings have a duplicate id: " + duplicates.join(", "))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -538,10 +551,10 @@ export class ValidateLayer extends DesugaringStep<LayerConfigJson> {
|
|||
}
|
||||
}
|
||||
if (json.tagRenderings !== undefined) {
|
||||
const r = new On("tagRenderings", new Each(new ValidateTagRenderings(json))).convert(json, context)
|
||||
warnings.push(...(r.warnings??[]))
|
||||
errors.push(...(r.errors??[]))
|
||||
information.push(...(r.information??[]))
|
||||
const r = new On("tagRenderings", new Each(new ValidateTagRenderings(json, this.knownImagePaths))).convert(json, context)
|
||||
warnings.push(...(r.warnings ?? []))
|
||||
errors.push(...(r.errors ?? []))
|
||||
information.push(...(r.information ?? []))
|
||||
}
|
||||
|
||||
if (json.presets !== undefined) {
|
||||
|
|
|
@ -547,7 +547,7 @@ class LengthTextField extends TextFieldDef {
|
|||
|
||||
constructor() {
|
||||
super(
|
||||
"length", "A geographical length in meters (rounded at two points). Will give an extra minimap with a measurement tool. Arguments: [ zoomlevel, preferredBackgroundMapType (comma separated) ], e.g. `[\"21\", \"map,photo\"]"
|
||||
"distance", "A geographical distance in meters (rounded at two points). Will give an extra minimap with a measurement tool. Arguments: [ zoomlevel, preferredBackgroundMapType (comma separated) ], e.g. `[\"21\", \"map,photo\"]"
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import CompiledTranslations from "../../assets/generated/CompiledTranslations";
|
|||
|
||||
export default class Translations {
|
||||
|
||||
static t = CompiledTranslations.t;
|
||||
static readonly t : typeof CompiledTranslations.t & Readonly<typeof CompiledTranslations.t> = CompiledTranslations.t;
|
||||
private static knownLanguages = new Set(known_languages.languages)
|
||||
constructor() {
|
||||
throw "Translations is static. If you want to intitialize a new translation, use the singular form"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"contributors": [
|
||||
{
|
||||
"commits": 3912,
|
||||
"commits": 3871,
|
||||
"contributor": "Pieter Vander Vennet"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -118,7 +118,8 @@
|
|||
"id": "Bangunan ini tidak memiliki nomor rumah",
|
||||
"es": "Esta edificación no tiene número",
|
||||
"zh_Hans": "这个建筑物没有门牌号",
|
||||
"da": "Denne bygning har intet husnummer"
|
||||
"da": "Denne bygning har intet husnummer",
|
||||
"zh_Hant": "這棟建築沒有門牌"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -373,7 +373,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "maxwidth:physical",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"20",
|
||||
"map"
|
||||
|
@ -406,7 +406,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width:separation",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
@ -440,7 +440,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width:opening",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
@ -474,7 +474,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "overlap",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
"amenity=bar",
|
||||
"amenity=pub",
|
||||
"amenity=cafe",
|
||||
"amenity=biergarten"
|
||||
"amenity=biergarten",
|
||||
"amenity=nightclub"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -94,6 +95,22 @@
|
|||
"preciseInput": {
|
||||
"preferredBackground": "map"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": [
|
||||
"amenity=nightclub"
|
||||
],
|
||||
"title": {
|
||||
"en": "a nightclub or disco",
|
||||
"nl": "een nachtclub of disco"
|
||||
},
|
||||
"description": {
|
||||
"en": "A <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks",
|
||||
"nl": "Een <b>nachtclub</b> met dansvloer, DJ met bijhorende lichteffecten en bar waar men (alcoholische) dranken kan nuttigen"
|
||||
},
|
||||
"preciseInput": {
|
||||
"preferredBackground": "map"
|
||||
}
|
||||
}
|
||||
],
|
||||
"title": {
|
||||
|
@ -209,6 +226,13 @@
|
|||
"es": "Un espacio abierto donde se sirve cerveza, típico de Alemania"
|
||||
},
|
||||
"hideInAnswer": "_country!=de"
|
||||
},
|
||||
{
|
||||
"if": "amenity=nightclub",
|
||||
"then": {
|
||||
"en": "This is a <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks",
|
||||
"nl": "Dit is een <b>nachtclub</b> met dansvloer, DJ met bijhorende lichteffecten en bar waar men (alcoholische) dranken kan nuttigen"
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": "Classification"
|
||||
|
@ -219,6 +243,7 @@
|
|||
"phone",
|
||||
"payment-options",
|
||||
"wheelchair-access",
|
||||
"smoking",
|
||||
"service:electricity",
|
||||
"dog-access",
|
||||
"reviews"
|
||||
|
@ -272,6 +297,10 @@
|
|||
{
|
||||
"if": "amenity=cafe",
|
||||
"then": "circle:white;./assets/layers/cafe_pub/cafe.svg"
|
||||
},
|
||||
{
|
||||
"if": "amenity=nightclub",
|
||||
"then": "circle:white;./assets/layers/cafe_pub/nightclub.svg"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -9,6 +9,16 @@
|
|||
"https://wiki.openstreetmap.org/wiki/File:Cafe-16.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "nightclub.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"Osm Carto"
|
||||
],
|
||||
"sources": [
|
||||
"https://wiki.openstreetmap.org/wiki/File:Nightclub-16.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pub.svg",
|
||||
"license": "CC0",
|
||||
|
|
27
assets/layers/cafe_pub/nightclub.svg
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
id="svg2">
|
||||
<metadata id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs id="defs6"/>
|
||||
<rect width="16" height="16" x="0" y="0" id="canvas" style="fill:none;stroke:none;visibility:hidden"/>
|
||||
<path d="M 13.006803,0.00308957 3.0068028,2.0030896 l 0,8.5624994 c -0.385369,-0.06933 -0.787572,-0.07549 -1.1875,0.03125 -1.15478198,0.308194 -2.01331698,1.387352 -1.78124998,2.25 0.232067,0.862648 1.50146898,1.370694 2.65624998,1.0625 1.154781,-0.308194 1.8125,-1.336236 1.8125,-2.25 l 0,-6.9687494 7.0000002,-1.375 0,5.6249997 c -0.385334,-0.06124 -0.787622,-0.04422 -1.1875,0.0625 -1.1546372,0.308156 -2.0130612,1.3561497 -1.7812502,2.2187497 0.232265,0.862479 1.5016132,1.370655 2.6562502,1.0625 1.154637,-0.308156 1.8125,-1.28125 1.8125,-2.28125 z"
|
||||
id="nightclub"
|
||||
style="fill:#C77400;fill-opacity:1;fill-rule:nonzero;stroke:none" transform="translate(1,1)"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
|
@ -836,7 +836,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width:carriageway",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"20",
|
||||
"map"
|
||||
|
@ -1260,7 +1260,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "cycleway:buffer",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"20",
|
||||
"map"
|
||||
|
|
|
@ -338,7 +338,7 @@
|
|||
},
|
||||
"freeform": {
|
||||
"key": "width",
|
||||
"type": "length"
|
||||
"type": "distance"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
@ -17,6 +17,22 @@
|
|||
],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "SocialImageBanner.png",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"Pieter Vander Vennet"
|
||||
],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "SocialImageBanner.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"Pieter Vander Vennet"
|
||||
],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "SocialImageSmall.png",
|
||||
"license": "CC-BY-SA 4.0",
|
||||
|
|
|
@ -141,16 +141,6 @@
|
|||
"https://commons.wikimedia.org/wiki/File:Camera_font_awesome.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "cash.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"Online Web Fonts"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.onlinewebfonts.com/icon/464494"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "checkbox-empty.svg",
|
||||
"license": "CC0",
|
||||
|
@ -859,16 +849,6 @@
|
|||
],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "nfc_card.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"Stijn Wens"
|
||||
],
|
||||
"sources": [
|
||||
"https://wens.be/free-antwerpenize-bicycle-font"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "no_checkmark.svg",
|
||||
"license": "CC0; trivial",
|
||||
|
@ -951,16 +931,6 @@
|
|||
"https://github.com/twitter/twemoji"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "payment_card.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
" \tMaxi Koichi (maxixam)"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Credit_Card_-_The_Noun_Project.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pencil.svg",
|
||||
"license": "MIT",
|
||||
|
@ -983,26 +953,6 @@
|
|||
" https://commons.wikimedia.org/wiki/File:Octicons-pencil.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "phone.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"@ tyskrat"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.onlinewebfonts.com/icon/1059"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "phone.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"@ tyskrat"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.onlinewebfonts.com/icon/1059"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pin.svg",
|
||||
"license": "CC0; trivial",
|
||||
|
@ -1151,18 +1101,6 @@
|
|||
"https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/AUTHORS.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "send_email.svg",
|
||||
"license": "CC0; trivial",
|
||||
"authors": [],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "send_email.svg",
|
||||
"license": "CC0; trivial",
|
||||
"authors": [],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "share.svg",
|
||||
"license": "CC0; trivial",
|
||||
|
@ -1175,16 +1113,6 @@
|
|||
"authors": [],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "smartphone.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"To Uyen"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Smartphone_icon_-_Noun_Project_283536.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "speech_bubble.svg",
|
||||
"license": "CC-BY 4.0",
|
||||
|
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
@ -5,6 +5,7 @@
|
|||
"phonelink",
|
||||
"emaillink",
|
||||
"wikipedialink",
|
||||
"smokingicon",
|
||||
"osmlink",
|
||||
"sharelink"
|
||||
],
|
||||
|
@ -20,6 +21,7 @@
|
|||
},
|
||||
"mappings": [
|
||||
{
|
||||
"#": "ignore-image-in-then",
|
||||
"if": "wikipedia=",
|
||||
"then": "<a href='https://www.wikidata.org/wiki/{wikidata}' target='_blank'><img src='./assets/svg/wikidata.svg' alt='WD'/></a>"
|
||||
}
|
||||
|
@ -59,13 +61,27 @@
|
|||
]
|
||||
},
|
||||
"phonelink": {
|
||||
"render": "<a href='tel:{phone}'><img textmode='\uD83D\uDCDE' alt='phone' src='./assets/svg/phone.svg'/></a>",
|
||||
"render": "<a href='tel:{phone}'><img textmode='\uD83D\uDCDE' alt='phone' src='./assets/tagRenderings/phone.svg'/></a>",
|
||||
"condition": "phone~*"
|
||||
},
|
||||
"emaillink": {
|
||||
"render": "<a href='mailto:{email}'><img textmode='✉️' alt='email' src='./assets/svg/send_email.svg'/></a>",
|
||||
"render": "<a href='mailto:{email}'><img textmode='✉️' alt='email' src='./assets/tagRenderings/send_email.svg'/></a>",
|
||||
"condition": "email~*"
|
||||
},
|
||||
"smokingicon": {
|
||||
"mappings": [
|
||||
{
|
||||
"#": "ignore-image-in-then",
|
||||
"if": "smoking=no",
|
||||
"then": "<img textmode='\uD83D\uDEAD️' alt='no-smoking' src='./assets/tagRenderings/no_smoking.svg'/>"
|
||||
},
|
||||
{
|
||||
"#": "ignore-image-in-then",
|
||||
"if": "smoking=yes",
|
||||
"then": "<img textmode='\uD83D\uDEAC️' alt='smoking-allowed' src='./assets/tagRenderings/smoking.svg'/>"
|
||||
}
|
||||
]
|
||||
},
|
||||
"osmlink": {
|
||||
"render": "<a href='https://openstreetmap.org/{id}' target='_blank'><img alt='on osm' textmode='\uD83D\uDDFA️' src='./assets/svg/osm-logo-us.svg'/></a>",
|
||||
"mappings": [
|
||||
|
@ -74,6 +90,7 @@
|
|||
"then": ""
|
||||
},
|
||||
{
|
||||
"#": "ignore-image-in-then",
|
||||
"if": "_backend~*",
|
||||
"then": "<a href='{_backend}/{id}' target='_blank'><img src='./assets/svg/osm-logo-us.svg'/></a>"
|
||||
}
|
||||
|
|
96
assets/tagRenderings/license_info.json
Normal file
|
@ -0,0 +1,96 @@
|
|||
[
|
||||
{
|
||||
"path": "cash.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"Online Web Fonts"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.onlinewebfonts.com/icon/464494"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "nfc_card.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"Stijn Wens"
|
||||
],
|
||||
"sources": [
|
||||
"https://wens.be/free-antwerpenize-bicycle-font"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "no_smoking.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"AIGA"
|
||||
],
|
||||
"sources": [
|
||||
"https://upload.wikimedia.org/wikipedia/commons/6/6b/No_Smoking.svg",
|
||||
"https://www.aiga.org/content.cfm/symbol-signs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "payment_card.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
" \tMaxi Koichi (maxixam)"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Credit_Card_-_The_Noun_Project.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "phone.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"@ tyskrat"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.onlinewebfonts.com/icon/1059"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "phone.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"@ tyskrat"
|
||||
],
|
||||
"sources": [
|
||||
"https://www.onlinewebfonts.com/icon/1059"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "send_email.svg",
|
||||
"license": "CC0; trivial",
|
||||
"authors": [],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "send_email.svg",
|
||||
"license": "CC0; trivial",
|
||||
"authors": [],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "smartphone.svg",
|
||||
"license": "CC-BY 3.0",
|
||||
"authors": [
|
||||
"To Uyen"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Smartphone_icon_-_Noun_Project_283536.svg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "smoking.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"Wiki-User03",
|
||||
"ZooFari"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Smoking_pictogram_(black).svg"
|
||||
]
|
||||
}
|
||||
]
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
160
assets/tagRenderings/no_smoking.svg
Normal file
|
@ -0,0 +1,160 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="439.54999"
|
||||
height="439.548"
|
||||
viewBox="0 0 439.54999 439.548"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.47 r22583"
|
||||
sodipodi:docname="No_Smoking.svg"><metadata
|
||||
id="metadata53"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs51"><inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 250 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="500 : 250 : 1"
|
||||
inkscape:persp3d-origin="250 : 166.66667 : 1"
|
||||
id="perspective55" /></defs><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="750"
|
||||
id="namedview49"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.472"
|
||||
inkscape:cx="219.747"
|
||||
inkscape:cy="221.158"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" />
|
||||
<circle
|
||||
style="fill:#ffffff;stroke:#000000"
|
||||
cx="249.5"
|
||||
cy="249.5"
|
||||
r="205"
|
||||
id="circle3"
|
||||
sodipodi:cx="249.5"
|
||||
sodipodi:cy="249.5"
|
||||
sodipodi:rx="205"
|
||||
sodipodi:ry="205"
|
||||
transform="translate(-30.253,-31.61)" />
|
||||
<g
|
||||
id="g5"
|
||||
transform="translate(-30.253,-31.61)">
|
||||
<g
|
||||
id="g7">
|
||||
<g
|
||||
id="g9">
|
||||
<g
|
||||
id="g11">
|
||||
<rect
|
||||
x="105.403"
|
||||
y="257.423"
|
||||
width="246.02901"
|
||||
height="39.354"
|
||||
id="rect13" />
|
||||
</g>
|
||||
<g
|
||||
id="g15">
|
||||
<g
|
||||
id="g17">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:13.18700027;stroke-linejoin:round;stroke-miterlimit:10"
|
||||
d="m 274.445,100.269 c -23.356,0 -32.885,18.899 -32.885,33.48 0,16.618 13.668,34.512 39.566,32.992 -8.953,15.205 -1.094,39.916 20.144,39.916 0.06,0 35.414,0 35.414,0 18.898,0 28.707,10.047 28.707,25.579 v 18.056"
|
||||
id="path19" />
|
||||
</g>
|
||||
<g
|
||||
id="g21">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:13.18700027;stroke-linejoin:round;stroke-miterlimit:10"
|
||||
d="m 285.789,113.105 c 23.736,0 39.488,16.49 39.488,36.692 0,7.809 -2.933,17.27 -8.881,25.473 h 20.938 c 30.438,0 48.593,25.359 48.593,50.775 v 24.247"
|
||||
id="path23" />
|
||||
</g>
|
||||
<g
|
||||
id="g25">
|
||||
|
||||
<line
|
||||
style="fill:none;stroke:#000000;stroke-width:13.18700027;stroke-linejoin:round;stroke-miterlimit:10"
|
||||
x1="365.39099"
|
||||
y1="256.79901"
|
||||
x2="365.39099"
|
||||
y2="296.621"
|
||||
id="line27" />
|
||||
</g>
|
||||
<g
|
||||
id="g29">
|
||||
|
||||
<line
|
||||
style="fill:none;stroke:#000000;stroke-width:13.18700027;stroke-linejoin:round;stroke-miterlimit:10"
|
||||
x1="386.005"
|
||||
y1="256.79901"
|
||||
x2="386.005"
|
||||
y2="296.621"
|
||||
id="line31" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g33">
|
||||
<rect
|
||||
x="273.44101"
|
||||
y="89.786003"
|
||||
style="fill:#ffffff"
|
||||
width="13.187"
|
||||
height="32.618999"
|
||||
id="rect35" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g37">
|
||||
|
||||
<line
|
||||
style="fill:none;stroke:#ffffff;stroke-width:55;stroke-miterlimit:10"
|
||||
x1="393.35001"
|
||||
y1="392.509"
|
||||
x2="110.112"
|
||||
y2="109.275"
|
||||
id="line39" />
|
||||
<g
|
||||
id="g41">
|
||||
<path
|
||||
style="fill:none;stroke:#ff0000;stroke-width:49;stroke-miterlimit:10"
|
||||
d="m 250.029,446.658 c -107.846,0 -195.276,-87.428 -195.276,-195.271 0,-107.848 87.43,-195.277 195.276,-195.277 107.845,0 195.274,87.429 195.274,195.277 0,107.843 -87.429,195.271 -195.274,195.271 z"
|
||||
id="path43" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:49;stroke-miterlimit:10"
|
||||
d="M 250.029,251.387"
|
||||
id="path45" />
|
||||
</g>
|
||||
|
||||
<line
|
||||
style="fill:none;stroke:#ff0000;stroke-width:51.11999893;stroke-miterlimit:10"
|
||||
x1="392.86801"
|
||||
y1="392.19101"
|
||||
x2="109.63"
|
||||
y2="108.957"
|
||||
id="line47" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 670 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
@ -745,7 +745,7 @@
|
|||
{
|
||||
"if": "payment:cash=yes",
|
||||
"ifnot": "payment:cash=no",
|
||||
"icon": "./assets/svg/cash.svg",
|
||||
"icon": "./assets/tagRenderings/cash.svg",
|
||||
"then": {
|
||||
"en": "Cash is accepted here",
|
||||
"nl": "Cash geld wordt hier aanvaard",
|
||||
|
@ -773,7 +773,7 @@
|
|||
{
|
||||
"if": "payment:cards=yes",
|
||||
"ifnot": "payment:cards=no",
|
||||
"icon": "./assets/svg/payment_card.svg",
|
||||
"icon": "./assets/tagRenderings/payment_card.svg",
|
||||
"then": {
|
||||
"en": "Payment cards are accepted here",
|
||||
"nl": "Betalen met bankkaarten kan hier",
|
||||
|
@ -807,7 +807,7 @@
|
|||
{
|
||||
"if": "payment:app=yes",
|
||||
"ifnot": "payment:app=no",
|
||||
"icon": "./assets/svg/smartphone.svg",
|
||||
"icon": "./assets/tagRenderings/smartphone.svg",
|
||||
"then": {
|
||||
"en": "Payment is done using a dedicated app",
|
||||
"nl": "Betalen via een app van het netwerk",
|
||||
|
@ -828,7 +828,7 @@
|
|||
{
|
||||
"if": "payment:membership_card=yes",
|
||||
"ifnot": "payment:membership_card=no",
|
||||
"icon": "./assets/svg/nfc_card.svg",
|
||||
"icon": "./assets/tagRenderings/nfc_card.svg",
|
||||
"then": {
|
||||
"en": "Payment is done using a membership card",
|
||||
"nl": "Betalen via een lidkaart van het netwerk",
|
||||
|
@ -1031,5 +1031,40 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"smoking": {
|
||||
"question": {
|
||||
"en": "Is smoking allowed at {title()}?"
|
||||
},
|
||||
"#condition": "Based on https://en.wikipedia.org/wiki/List_of_smoking_bans",
|
||||
"condition": "_country!~al|be",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "smoking=yes",
|
||||
"icon": {
|
||||
"path": "./assets/tagRenderings/smoking.svg",
|
||||
"size": "small"
|
||||
},
|
||||
"then": {
|
||||
"en": "Smoking is <b>allowed</b>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "smoking=no",
|
||||
"icon": {
|
||||
"path": "./assets/tagRenderings/no_smoking.svg",
|
||||
"size": "small"
|
||||
},
|
||||
"then": {
|
||||
"en": "Smoking is <b>not allowed</b>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": "smoking=outside",
|
||||
"then": {
|
||||
"en": "Smoking is <b>allowed outside</b>."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 702 B |
8
assets/tagRenderings/smoking.svg
Normal file
|
@ -0,0 +1,8 @@
|
|||
<svg enable-background="new -4.333 -4.333 520.278 520.278" height="520.278px" version="1.1" viewBox="-4.333 -4.333 520.278 520.278" width="520.278px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
|
||||
<defs>
|
||||
</defs>
|
||||
<g transform="translate(-607.435, -195.365)">
|
||||
<path d="M955.58,363.71c-16.461,1.609-25.673,17.126-25.969,31.875-0.285,14.252,8.423,26.381,21.25,29.281,5.662,1.28,3.225,1.647,3.5,5.781,2.688,40.218,40.279,17.878,56.094,29.343,8.143,5.903,6.139,10.834,6.781,20.344h8.906c0-13.286,1.794-20.888-11.094-28.5-14.037-8.291-33.764,1.58-46.344-8.156-5.124-3.966-5.494-12.199-2.719-18.812,1.838-4.379-0.617-8.315-5.625-8.219-11.188,0.215-19.953-6.958-21.188-18.125-1.258-11.377,4.419-22.228,16.406-24.531v-10.257zm10.37,10.31v9.844c8.9,1.657,17.617,4.822,21.281,13.844,3.242,7.983,1.651,16.891-2.312,24.406-1.902,3.606-0.29,10.151,8.781,10,16.79-0.279,30.641,6.578,35.625,24.125,2.84,9.996,2.136,14.072,1.938,23.875h9.5c0.024-19.672,0.699-15.814-2.219-25.844-6.508-22.367-17.854-29.955-39.438-31.343-3.1-0.2-3.885,0.312-2.75-3.062,2.551-7.58,3.64-18.591-3.125-29.719-5.78-9.60-16.10-16.28-27.23-16.14zm-286.22,112.07v44.969h318.031v-44.969h-318.03zm324.47,0v44.969h7.656v-44.969h-7.697zm13.2,0v44.969h9v-44.969h-9.041zm14.4,0v44.969h9.219v-44.969h-9.172z"/>
|
||||
<path d="M1101.7,451.17c0,131.69-106.76,238.45-238.45,238.45s-238.46-106.76-238.46-238.45,106.76-238.45,238.45-238.45,238.46,106.76,238.46,238.45z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="43.3749"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -1,13 +1,24 @@
|
|||
{
|
||||
"id": "mapcomplete-changes",
|
||||
"title": {
|
||||
"en": "Changes made with MapComplete"
|
||||
"en": "Changes made with MapComplete",
|
||||
"de": "Änderungen mit MapComplete",
|
||||
"es": "Cambios hechos con MapComplete",
|
||||
"nb_NO": "Endringer utført med MapComplete",
|
||||
"nl": "Wijzigingen gemaakt met MapComplete"
|
||||
},
|
||||
"shortDescription": {
|
||||
"en": "Shows changes made by MapComplete"
|
||||
"en": "Shows changes made by MapComplete",
|
||||
"de": "Zeigt Änderungen von MapComplete",
|
||||
"es": "Muestra los cambios hechos por MapComplete",
|
||||
"nb_NO": "Vis endringer utført med MapComplete",
|
||||
"nl": "Toont wijzigingen gemaakt met MapComplete"
|
||||
},
|
||||
"description": {
|
||||
"en": "This maps shows all the changes made with MapComplete"
|
||||
"en": "This maps shows all the changes made with MapComplete",
|
||||
"de": "Diese Karte zeigt alle Änderungen die mit MapComplete gemacht wurden",
|
||||
"es": "Este mapa muestra todos los cambios hechos con MapComplete",
|
||||
"nl": "Deze kaart toont alle wijzigingen die met MapComplete werden gemaakt"
|
||||
},
|
||||
"maintainer": "",
|
||||
"icon": "./assets/svg/logo.svg",
|
||||
|
@ -22,7 +33,10 @@
|
|||
{
|
||||
"id": "mapcomplete-changes",
|
||||
"name": {
|
||||
"en": "Changeset centers"
|
||||
"en": "Changeset centers",
|
||||
"de": "Schwerpunkte von Änderungssätzen",
|
||||
"es": "Centros de conjuntos de cambios",
|
||||
"nb_NO": "Endringssettsenter"
|
||||
},
|
||||
"minzoom": 0,
|
||||
"source": {
|
||||
|
@ -36,35 +50,55 @@
|
|||
],
|
||||
"title": {
|
||||
"render": {
|
||||
"en": "Changeset for {theme}"
|
||||
"en": "Changeset for {theme}",
|
||||
"de": "Änderungen für {theme}",
|
||||
"es": "Conjunto de cambios para {theme}",
|
||||
"nb_NO": "Endringssett for {theme}",
|
||||
"nl": "Wijzigingset voor {theme}"
|
||||
}
|
||||
},
|
||||
"description": {
|
||||
"en": "Shows all MapComplete changes"
|
||||
"en": "Shows all MapComplete changes",
|
||||
"de": "Zeigt alle MapComplete Änderungen",
|
||||
"es": "Muestra todos los cambios de MapComplete",
|
||||
"nl": "Toont alle wijzigingen met MapComplete"
|
||||
},
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "render_id",
|
||||
"render": {
|
||||
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
|
||||
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
|
||||
"de": "Änderung <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
|
||||
"es": "Conjunto de cambios <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
|
||||
"nb_NO": "Endringssett <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
|
||||
"nl": "Wijzigingset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "contributor",
|
||||
"render": {
|
||||
"en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
|
||||
"en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>",
|
||||
"de": "Änderung wurde von <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a> gemacht",
|
||||
"es": "Cambio hecho por <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>",
|
||||
"nl": "Wijziging gemaakt door <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "theme",
|
||||
"render": {
|
||||
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
|
||||
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
|
||||
"de": "Änderung mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
|
||||
"es": "Cambio con tema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
|
||||
"nl": "Wijziging met thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
|
||||
},
|
||||
"mappings": [
|
||||
{
|
||||
"if": "theme~http.*",
|
||||
"then": {
|
||||
"en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
|
||||
"en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>",
|
||||
"de": "Änderung mit <b>inoffiziellem</b> Thema <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>",
|
||||
"es": "Cambio con tema <b>no oficial</b> <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>",
|
||||
"nl": "Wijziging met <b>officieus</b> thema <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -336,7 +370,11 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Themename contains {search}"
|
||||
"en": "Themename contains {search}",
|
||||
"de": "Themenname enthält {search}",
|
||||
"es": "Nombre del tema contiene {search}",
|
||||
"nb_NO": "Temanavn inneholder {search}",
|
||||
"nl": "Themanaam bevat {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -352,7 +390,10 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Made by contributor {search}"
|
||||
"en": "Made by contributor {search}",
|
||||
"de": "Erstellt von {search}",
|
||||
"es": "Hecho por contributor/a {search}",
|
||||
"nl": "Gemaakt door bijdrager {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -368,7 +409,10 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "<b>Not</b> made by contributor {search}"
|
||||
"en": "<b>Not</b> made by contributor {search}",
|
||||
"de": "<b>Nicht</b> erstellt von {search}",
|
||||
"es": "<b>No</b> hecho por contributor/a {search}",
|
||||
"nl": "<b>Niet</b> gemaakt door bijdrager {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -383,7 +427,10 @@
|
|||
{
|
||||
"id": "link_to_more",
|
||||
"render": {
|
||||
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
|
||||
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>",
|
||||
"de": "Weitere Statistiken finden Sie <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>",
|
||||
"es": "Se pueden encontrar más estadísticas <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>aquí</a>",
|
||||
"nl": "Meer statistieken kunnen <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a> gevonden worden"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
"condition": "sidewalk:left|right=yes",
|
||||
"freeform": {
|
||||
"key": "sidewalk:left|right:width",
|
||||
"type": "length",
|
||||
"type": "distance",
|
||||
"helperArgs": [
|
||||
"21",
|
||||
"map"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"contributor": "Iago"
|
||||
},
|
||||
{
|
||||
"commits": 22,
|
||||
"commits": 23,
|
||||
"contributor": "Supaplex"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -548,9 +548,6 @@
|
|||
"date": {
|
||||
"description": "Una data, començant per l'any"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Un número"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Una orientació"
|
||||
},
|
||||
|
|
|
@ -634,9 +634,6 @@
|
|||
"date": {
|
||||
"description": "En dato, der starter med årstallet"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Et tal"
|
||||
},
|
||||
"direction": {
|
||||
"description": "En retning"
|
||||
},
|
||||
|
|
|
@ -456,8 +456,10 @@
|
|||
"sendReason": "Ich habe Ihnen diese Nachricht geschickt, weil <b>{sender}</b> mich gebeten hat, diese mit <code>{cmd}</code> zu senden"
|
||||
},
|
||||
"documentation": {
|
||||
"argid": "Die ID einer {list} oder {list_end}, für welche die Dokumente benötigt werden. Alternativ können Sie auch eine von {coded_list} schreiben, um die verfügbaren IDs zu sehen.",
|
||||
"didYouMean": " Vielleicht meinten Sie einen von: ",
|
||||
"docs": "Ruft die Dokumentation zu einer MapComplete-Ebene, einem Thema oder einem URL-Parameter ab",
|
||||
"noIdIntro": "Geben Sie eine ID an, um weitere Informationen über ein MapComplete-Programmierelement zu erhalten. Bekannte Typen sind {list}",
|
||||
"notFound": "Kein {singular} mit Namen <code>{id}</code> gefunden.",
|
||||
"urlParam": "URL-Parameter <code>{id}<code></code></code>"
|
||||
},
|
||||
|
@ -753,9 +755,6 @@
|
|||
"date": {
|
||||
"description": "Ein Datum, beginnend mit der Jahreszahl"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Eine Zahl"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Eine Himmelsrichtung"
|
||||
},
|
||||
|
|
|
@ -828,12 +828,12 @@
|
|||
"date": {
|
||||
"description": "A date, starting with the year"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "A number"
|
||||
},
|
||||
"direction": {
|
||||
"description": "An orientation"
|
||||
},
|
||||
"distance": {
|
||||
"description": "A distance in meter"
|
||||
},
|
||||
"email": {
|
||||
"description": "email-adres",
|
||||
"feedback": "This is not a valid email address",
|
||||
|
@ -846,9 +846,6 @@
|
|||
"int": {
|
||||
"description": "a whole number"
|
||||
},
|
||||
"length": {
|
||||
"description": "a length measurement in meter"
|
||||
},
|
||||
"nat": {
|
||||
"description": "a positive, whole number or zero",
|
||||
"mustBePositive": "This number should be positive",
|
||||
|
|
|
@ -516,9 +516,6 @@
|
|||
"deactivate": "Deshabilitar los botones de traducción"
|
||||
},
|
||||
"validation": {
|
||||
"decimal": {
|
||||
"description": "Un número"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Una orientación"
|
||||
},
|
||||
|
|
|
@ -144,9 +144,6 @@
|
|||
"date": {
|
||||
"description": "Tanggal, dimulai dari tahun"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Nomor"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Orientasi"
|
||||
},
|
||||
|
|
|
@ -1274,6 +1274,10 @@
|
|||
"2": {
|
||||
"description": "A <b>cafe</b> to drink tea, coffee or an alcoholical bevarage in a quiet environment",
|
||||
"title": "a cafe"
|
||||
},
|
||||
"3": {
|
||||
"description": "A <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks",
|
||||
"title": "a nightclub or disco"
|
||||
}
|
||||
},
|
||||
"tagRenderings": {
|
||||
|
@ -1293,6 +1297,9 @@
|
|||
},
|
||||
"4": {
|
||||
"then": "An open space where beer is served, typically seen in Germany"
|
||||
},
|
||||
"5": {
|
||||
"then": "This is a <b>nightclub</b> or disco with a focus on dancing, music by a DJ with accompanying light show and a bar to get (alcoholic) drinks"
|
||||
}
|
||||
},
|
||||
"question": "What kind of cafe is this?"
|
||||
|
|
|
@ -1280,6 +1280,10 @@
|
|||
"2": {
|
||||
"description": "Dit is een <b>cafe</b> - een plaats waar men rustig kan zitten om een thee, koffie of alcoholische drank te nuttigen.",
|
||||
"title": "een café"
|
||||
},
|
||||
"3": {
|
||||
"description": "Een <b>nachtclub</b> met dansvloer, DJ met bijhorende lichteffecten en bar waar men (alcoholische) dranken kan nuttigen",
|
||||
"title": "een nachtclub of disco"
|
||||
}
|
||||
},
|
||||
"tagRenderings": {
|
||||
|
@ -1299,6 +1303,9 @@
|
|||
},
|
||||
"4": {
|
||||
"then": "Een open ruimte waar bier geserveerd wordt. Typisch in Duitsland"
|
||||
},
|
||||
"5": {
|
||||
"then": "Dit is een <b>nachtclub</b> met dansvloer, DJ met bijhorende lichteffecten en bar waar men (alcoholische) dranken kan nuttigen"
|
||||
}
|
||||
},
|
||||
"question": "Welk soort café is dit?"
|
||||
|
|
|
@ -5,6 +5,13 @@
|
|||
"tagRenderings": {
|
||||
"fixme": {
|
||||
"question": "這裡需要修什麼?請直接解釋"
|
||||
},
|
||||
"housenumber": {
|
||||
"mappings": {
|
||||
"0": {
|
||||
"then": "這棟建築沒有門牌"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -480,9 +480,6 @@
|
|||
"date": {
|
||||
"description": "En dato, som starter med året"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Et tall"
|
||||
},
|
||||
"direction": {
|
||||
"description": "En retning"
|
||||
},
|
||||
|
|
|
@ -753,12 +753,12 @@
|
|||
"date": {
|
||||
"description": "Een datum (beginnend met het jaar)"
|
||||
},
|
||||
"decimal": {
|
||||
"description": "Een getal"
|
||||
},
|
||||
"direction": {
|
||||
"description": "Een orientatie"
|
||||
},
|
||||
"distance": {
|
||||
"description": "Een afstand in meter"
|
||||
},
|
||||
"email": {
|
||||
"description": "email-adres",
|
||||
"feedback": "Dit is geen geldig email-adres",
|
||||
|
|
|
@ -91,6 +91,20 @@
|
|||
},
|
||||
"question": "Does this amenity have electrical outlets, available to customers when they are inside?"
|
||||
},
|
||||
"smoking": {
|
||||
"mappings": {
|
||||
"0": {
|
||||
"then": "Smoking is <b>allowed</b>"
|
||||
},
|
||||
"1": {
|
||||
"then": "Smoking is <b>not allowed</b>"
|
||||
},
|
||||
"2": {
|
||||
"then": "Smoking is <b>allowed outside</b>."
|
||||
}
|
||||
},
|
||||
"question": "Is smoking allowed at {title()}?"
|
||||
},
|
||||
"website": {
|
||||
"question": "What is the website of {title()}?"
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "npm run generate:layeroverview && npm run strt",
|
||||
"strt": "export NODE_OPTIONS=--max_old_space_size=8364 && parcel serve *.html UI/** Logic/** assets/*.json assets/svg/* assets/generated/* assets/layers/*/*.svg assets/layers/*/*/*/*.svg assets/layers/*/*.jpg assets/layers/*/*.png assets/layers/*/*.css assets/tagRenderings/*.json assets/themes/*/*.svg assets/themes/*/*.ttf assets/themes/*/*/*.ttf assets/themes/*/*.otf assets/themes/*/*/*.otf assets/themes/*/*.css assets/themes/*/*.jpg assets/themes/*/*.woff assets/themes/*/*.png vendor/* vendor/*/*",
|
||||
"strt": "export NODE_OPTIONS=--max_old_space_size=8364 && parcel serve *.html UI/** Logic/** assets/*.json assets/svg/* assets/generated/* assets/layers/*/*.svg assets/layers/*/*/*/*.svg assets/layers/*/*.jpg assets/layers/*/*.png assets/layers/*/*.css assets/tagRenderings/*.json assets/themes/*/*.svg assets/themes/*/*.ttf assets/themes/*/*/*.ttf assets/themes/*/*.otf assets/themes/*/*/*.otf assets/themes/*/*.css assets/themes/*/*.jpg assets/themes/*/*.woff assets/themes/*/*.png vendor/* vendor/*/* assets/tagRenderings/*.svg",
|
||||
"strttest": "export NODE_OPTIONS=--max_old_space_size=8364 && parcel serve test.html",
|
||||
"watch:css": "tailwindcss -i index.css -o css/index-tailwind-output.css --watch",
|
||||
"generate:css": "tailwindcss -i index.css -o css/index-tailwind-output.css",
|
||||
|
|
|
@ -4,7 +4,12 @@ import * as licenses from "../assets/generated/license_info.json"
|
|||
import {LayoutConfigJson} from "../Models/ThemeConfig/Json/LayoutConfigJson";
|
||||
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
|
||||
import Constants from "../Models/Constants";
|
||||
import {PrevalidateTheme, ValidateLayer, ValidateThemeAndLayers} from "../Models/ThemeConfig/Conversion/Validation";
|
||||
import {
|
||||
PrevalidateTheme,
|
||||
ValidateLayer,
|
||||
ValidateTagRenderings,
|
||||
ValidateThemeAndLayers
|
||||
} from "../Models/ThemeConfig/Conversion/Validation";
|
||||
import {Translation} from "../UI/i18n/Translation";
|
||||
import {TagRenderingConfigJson} from "../Models/ThemeConfig/Json/TagRenderingConfigJson";
|
||||
import * as questions from "../assets/tagRenderings/questions.json";
|
||||
|
@ -14,19 +19,20 @@ import {PrepareLayer} from "../Models/ThemeConfig/Conversion/PrepareLayer";
|
|||
import {PrepareTheme} from "../Models/ThemeConfig/Conversion/PrepareTheme";
|
||||
import {DesugaringContext} from "../Models/ThemeConfig/Conversion/Conversion";
|
||||
import {Utils} from "../Utils";
|
||||
import {And} from "../Logic/Tags/And";
|
||||
|
||||
// This scripts scans 'assets/layers/*.json' for layer definition files and 'assets/themes/*.json' for theme definition files.
|
||||
// It spits out an overview of those to be used to load them
|
||||
|
||||
class LayerOverviewUtils {
|
||||
|
||||
writeSmallOverview(themes: { id: string, title: any, shortDescription: any, icon: string, hideFromOverview: boolean, mustHaveLanguage: boolean, layers: (LayerConfigJson | string | {builtin})[] }[]) {
|
||||
writeSmallOverview(themes: { id: string, title: any, shortDescription: any, icon: string, hideFromOverview: boolean, mustHaveLanguage: boolean, layers: (LayerConfigJson | string | { builtin })[] }[]) {
|
||||
const perId = new Map<string, any>();
|
||||
for (const theme of themes) {
|
||||
|
||||
const keywords : {}[] = []
|
||||
const keywords: {}[] = []
|
||||
for (const layer of (theme.layers ?? [])) {
|
||||
const l = <LayerConfigJson> layer;
|
||||
const l = <LayerConfigJson>layer;
|
||||
keywords.push({"*": l.id})
|
||||
keywords.push(l.title)
|
||||
keywords.push(l.description)
|
||||
|
@ -77,16 +83,19 @@ class LayerOverviewUtils {
|
|||
writeFileSync(`./assets/generated/layers/${layer.id}.json`, JSON.stringify(layer, null, " "), "UTF8");
|
||||
}
|
||||
|
||||
getSharedTagRenderings(): Map<string, TagRenderingConfigJson> {
|
||||
getSharedTagRenderings(knownImagePaths: Set<string>): Map<string, TagRenderingConfigJson> {
|
||||
const dict = new Map<string, TagRenderingConfigJson>();
|
||||
|
||||
const validator = new ValidateTagRenderings(undefined, knownImagePaths);
|
||||
for (const key in questions["default"]) {
|
||||
if (key === "id") {
|
||||
continue
|
||||
}
|
||||
questions[key].id = key;
|
||||
questions[key]["source"] = "shared-questions"
|
||||
dict.set(key, <TagRenderingConfigJson>questions[key])
|
||||
const config = <TagRenderingConfigJson>questions[key]
|
||||
validator.convertStrict(config, "generate-layer-overview:tagRenderings/questions.json:"+key)
|
||||
dict.set(key, config)
|
||||
}
|
||||
for (const key in icons["default"]) {
|
||||
if (key === "id") {
|
||||
|
@ -96,7 +105,9 @@ class LayerOverviewUtils {
|
|||
continue
|
||||
}
|
||||
icons[key].id = key;
|
||||
dict.set(key, <TagRenderingConfigJson>icons[key])
|
||||
const config = <TagRenderingConfigJson>icons[key]
|
||||
validator.convertStrict(config, "generate-layer-overview:tagRenderings/icons.json:"+key)
|
||||
dict.set(key,config)
|
||||
}
|
||||
|
||||
dict.forEach((value, key) => {
|
||||
|
@ -114,9 +125,9 @@ class LayerOverviewUtils {
|
|||
.filter(path => path.endsWith(".svg"))
|
||||
.filter(path => !path.startsWith("./assets/generated"))
|
||||
let errCount = 0;
|
||||
const exempt = ["assets/SocialImageTemplate.svg","assets/SocialImageTemplateWide.svg","assets/SocialImageBanner.svg", "assets/svg/osm-logo.svg"];
|
||||
const exempt = ["assets/SocialImageTemplate.svg", "assets/SocialImageTemplateWide.svg", "assets/SocialImageBanner.svg", "assets/svg/osm-logo.svg"];
|
||||
for (const path of allSvgs) {
|
||||
if(exempt.some(p => "./"+p === path)) {
|
||||
if (exempt.some(p => "./" + p === path)) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -128,7 +139,7 @@ class LayerOverviewUtils {
|
|||
throw "A core SVG is actually a PNG. Don't do this!"
|
||||
}
|
||||
}
|
||||
if(contents.indexOf("<text")>0){
|
||||
if (contents.indexOf("<text") > 0) {
|
||||
console.warn("The SVG at " + path + " contains a `text`-tag. This is highly discouraged. Every machine viewing your theme has their own font libary, and the font you choose might not be present, resulting in a different font being rendered. Solution: open your .svg in inkscape (or another program), select the text and convert it to a path")
|
||||
errCount++;
|
||||
|
||||
|
@ -183,7 +194,7 @@ class LayerOverviewUtils {
|
|||
// At the same time, an index of available layers is built.
|
||||
console.log(" ---------- VALIDATING BUILTIN LAYERS ---------")
|
||||
|
||||
const sharedTagRenderings = this.getSharedTagRenderings();
|
||||
const sharedTagRenderings = this.getSharedTagRenderings(knownImagePaths);
|
||||
const layerFiles = ScriptUtils.getLayerFiles();
|
||||
const sharedLayers = new Map<string, LayerConfigJson>()
|
||||
const state: DesugaringContext = {
|
||||
|
@ -194,7 +205,12 @@ class LayerOverviewUtils {
|
|||
for (const sharedLayerJson of layerFiles) {
|
||||
const context = "While building builtin layer " + sharedLayerJson.path
|
||||
const fixed = prepLayer.convertStrict(sharedLayerJson.parsed, context)
|
||||
const validator = new ValidateLayer(sharedLayerJson.path, true);
|
||||
|
||||
if(fixed.source.osmTags["and"] === undefined){
|
||||
fixed.source.osmTags = {"and": [fixed.source.osmTags]}
|
||||
}
|
||||
|
||||
const validator = new ValidateLayer(sharedLayerJson.path, true, knownImagePaths);
|
||||
validator.convertStrict(fixed, context)
|
||||
|
||||
if (sharedLayers.has(fixed.id)) {
|
||||
|
@ -209,24 +225,24 @@ class LayerOverviewUtils {
|
|||
return sharedLayers;
|
||||
}
|
||||
|
||||
private static publicLayerIdsFrom(themefiles: LayoutConfigJson[]): Set<string>{
|
||||
private static publicLayerIdsFrom(themefiles: LayoutConfigJson[]): Set<string> {
|
||||
const publicLayers = [].concat(...themefiles
|
||||
.filter(th => !th.hideFromOverview)
|
||||
.map(th => th.layers))
|
||||
|
||||
const publicLayerIds = new Set<string>()
|
||||
for (const publicLayer of publicLayers) {
|
||||
if(typeof publicLayer === "string"){
|
||||
if (typeof publicLayer === "string") {
|
||||
publicLayerIds.add(publicLayer)
|
||||
continue
|
||||
}
|
||||
if(publicLayer["builtin"] !== undefined){
|
||||
if (publicLayer["builtin"] !== undefined) {
|
||||
const bi = publicLayer["builtin"]
|
||||
if(typeof bi === "string"){
|
||||
if (typeof bi === "string") {
|
||||
publicLayerIds.add(bi)
|
||||
continue
|
||||
}
|
||||
bi.forEach(id=>publicLayerIds.add(id))
|
||||
bi.forEach(id => publicLayerIds.add(id))
|
||||
continue
|
||||
}
|
||||
publicLayerIds.add(publicLayer.id)
|
||||
|
@ -243,7 +259,7 @@ class LayerOverviewUtils {
|
|||
|
||||
const convertState: DesugaringContext = {
|
||||
sharedLayers,
|
||||
tagRenderings: this.getSharedTagRenderings(),
|
||||
tagRenderings: this.getSharedTagRenderings(knownImagePaths),
|
||||
publicLayers
|
||||
}
|
||||
for (const themeInfo of themeFiles) {
|
||||
|
@ -251,11 +267,11 @@ class LayerOverviewUtils {
|
|||
const themePath = themeInfo.path
|
||||
|
||||
new PrevalidateTheme().convertStrict(themeFile, themePath)
|
||||
try{
|
||||
try {
|
||||
|
||||
themeFile = new PrepareTheme(convertState).convertStrict(themeFile, themePath)
|
||||
|
||||
if(knownImagePaths === undefined){
|
||||
if (knownImagePaths === undefined) {
|
||||
throw "Could not load known images/licenses"
|
||||
}
|
||||
new ValidateThemeAndLayers(knownImagePaths, themePath, true, convertState.tagRenderings)
|
||||
|
@ -263,8 +279,8 @@ class LayerOverviewUtils {
|
|||
|
||||
this.writeTheme(themeFile)
|
||||
fixed.set(themeFile.id, themeFile)
|
||||
}catch(e){
|
||||
console.error("ERROR: could not prepare theme "+themePath+" due to "+e)
|
||||
} catch (e) {
|
||||
console.error("ERROR: could not prepare theme " + themePath + " due to " + e)
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import {existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync} from "fs
|
|||
import SmallLicense from "../Models/smallLicense";
|
||||
import ScriptUtils from "./ScriptUtils";
|
||||
|
||||
const prompt = require('prompt-sync')();
|
||||
|
||||
function validateLicenseInfo(l : SmallLicense){
|
||||
l.sources.map(s => new URL(s))
|
||||
|
@ -55,7 +56,6 @@ function missingLicenseInfos(licenseInfos: SmallLicense[], allIcons: string[]) {
|
|||
return missing;
|
||||
}
|
||||
|
||||
const prompt = require('prompt-sync')();
|
||||
|
||||
const knownLicenses = new Map<string, SmallLicense>()
|
||||
knownLicenses.set("me", {
|
||||
|
@ -64,45 +64,36 @@ knownLicenses.set("me", {
|
|||
license: "CC0",
|
||||
sources: []
|
||||
})
|
||||
|
||||
knownLicenses.set("streetcomplete", {
|
||||
authors: ["Tobias Zwick (westnordost)"],
|
||||
path: undefined,
|
||||
license: "CC0",
|
||||
sources: ["https://github.com/streetcomplete/StreetComplete/tree/master/res/graphics", "https://f-droid.org/packages/de.westnordost.streetcomplete/"]
|
||||
})
|
||||
|
||||
|
||||
knownLicenses.set("t", {
|
||||
authors: [],
|
||||
path: undefined,
|
||||
license: "CC0; trivial",
|
||||
sources: []
|
||||
})
|
||||
|
||||
knownLicenses.set("na", {
|
||||
authors: [],
|
||||
path: undefined,
|
||||
license: "CC0",
|
||||
sources: []
|
||||
})
|
||||
|
||||
knownLicenses.set("tv", {
|
||||
authors: ["Toerisme Vlaanderen"],
|
||||
path: undefined,
|
||||
license: "CC0",
|
||||
sources: ["https://toerismevlaanderen.be/pinjepunt","https://mapcomplete.osm.be/toerisme_vlaanderenn"]
|
||||
})
|
||||
|
||||
knownLicenses.set("tvf", {
|
||||
authors: ["Jo De Baerdemaeker "],
|
||||
path: undefined,
|
||||
license: "All rights reserved",
|
||||
sources: ["https://www.studiotype.be/fonts/flandersart"]
|
||||
})
|
||||
|
||||
|
||||
|
||||
knownLicenses.set("twemoji", {
|
||||
authors: ["Twemoji"],
|
||||
path: undefined,
|
||||
|
@ -154,7 +145,7 @@ function createLicenseInfoFor(path): void {
|
|||
function cleanLicenseInfo(allPaths: string[], allLicenseInfos: SmallLicense[]) {
|
||||
// Read the license info file from the generated assets, creates a compiled license info in every directory
|
||||
// Note: this removes all the old license infos
|
||||
for (const licensePath of licensePaths) {
|
||||
for (const licensePath of allPaths) {
|
||||
unlinkSync(licensePath)
|
||||
}
|
||||
|
||||
|
@ -219,10 +210,13 @@ function queryMissingLicenses(missingLicenses: string[]) {
|
|||
* Creates the humongous license_info in the generated assets, containing all licenses with a path relative to the root
|
||||
* @param licensePaths
|
||||
*/
|
||||
function createFullLicenseOverview(licensePaths) {
|
||||
function createFullLicenseOverview(licensePaths: string[]) {
|
||||
|
||||
const allLicenses: SmallLicense[] = []
|
||||
for (const licensePath of licensePaths) {
|
||||
if(!existsSync(licensePath)){
|
||||
continue
|
||||
}
|
||||
const licenses = <SmallLicense[]>JSON.parse(readFileSync(licensePath, "UTF-8"))
|
||||
for (const license of licenses) {
|
||||
validateLicenseInfo(license)
|
||||
|
@ -235,52 +229,54 @@ function createFullLicenseOverview(licensePaths) {
|
|||
writeFileSync("./assets/generated/license_info.json", JSON.stringify(allLicenses, null, " "))
|
||||
}
|
||||
|
||||
console.log("Checking and compiling license info")
|
||||
function main(args: string[]){
|
||||
|
||||
if (!existsSync("./assets/generated")) {
|
||||
mkdirSync("./assets/generated")
|
||||
}
|
||||
console.log("Checking and compiling license info")
|
||||
|
||||
if (!existsSync("./assets/generated")) {
|
||||
mkdirSync("./assets/generated")
|
||||
}
|
||||
|
||||
|
||||
let contents = ScriptUtils.readDirRecSync("./assets")
|
||||
.filter(entry => entry.indexOf("./assets/generated") != 0)
|
||||
let licensePaths = contents.filter(entry => entry.indexOf("license_info.json") >= 0)
|
||||
let licenseInfos = generateLicenseInfos(licensePaths);
|
||||
|
||||
|
||||
|
||||
const artwork = contents.filter(pth => pth.match(/(.svg|.png|.jpg|.ttf|.otf|.woff)$/i) != null)
|
||||
const missingLicenses = missingLicenseInfos(licenseInfos, artwork)
|
||||
if (process.argv.indexOf("--prompt") >= 0 || process.argv.indexOf("--query") >= 0) {
|
||||
queryMissingLicenses(missingLicenses)
|
||||
contents = ScriptUtils.readDirRecSync("./assets")
|
||||
let contents = ScriptUtils.readDirRecSync("./assets")
|
||||
.filter(entry => entry.indexOf("./assets/generated") != 0)
|
||||
licensePaths = contents.filter(entry => entry.indexOf("license_info.json") >= 0)
|
||||
licenseInfos = generateLicenseInfos(licensePaths);
|
||||
}
|
||||
let licensePaths = contents.filter(entry => entry.indexOf("license_info.json") >= 0)
|
||||
let licenseInfos = generateLicenseInfos(licensePaths);
|
||||
|
||||
const invalidLicenses = licenseInfos.filter(l => (l.license ?? "") === "").map(l => `License for artwork ${l.path} is empty string or undefined`)
|
||||
for (const licenseInfo of licenseInfos) {
|
||||
for (const source of licenseInfo.sources) {
|
||||
if (source == "") {
|
||||
invalidLicenses.push("Invalid license: empty string in " + JSON.stringify(licenseInfo))
|
||||
}
|
||||
try {
|
||||
new URL(source);
|
||||
} catch {
|
||||
invalidLicenses.push("Not a valid URL: " + source)
|
||||
|
||||
|
||||
const artwork = contents.filter(pth => pth.match(/(.svg|.png|.jpg|.ttf|.otf|.woff)$/i) != null)
|
||||
const missingLicenses = missingLicenseInfos(licenseInfos, artwork)
|
||||
if (args.indexOf("--prompt") >= 0 || args.indexOf("--query") >= 0) {
|
||||
queryMissingLicenses(missingLicenses)
|
||||
return main([])
|
||||
}
|
||||
|
||||
const invalidLicenses = licenseInfos.filter(l => (l.license ?? "") === "").map(l => `License for artwork ${l.path} is empty string or undefined`)
|
||||
for (const licenseInfo of licenseInfos) {
|
||||
for (const source of licenseInfo.sources) {
|
||||
if (source == "") {
|
||||
invalidLicenses.push("Invalid license: empty string in " + JSON.stringify(licenseInfo))
|
||||
}
|
||||
try {
|
||||
new URL(source);
|
||||
} catch {
|
||||
invalidLicenses.push("Not a valid URL: " + source)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (missingLicenses.length > 0) {
|
||||
const msg = `There are ${missingLicenses.length} licenses missing and ${invalidLicenses.length} invalid licenses.`
|
||||
console.log(missingLicenses.concat(invalidLicenses).join("\n"))
|
||||
console.error(msg)
|
||||
if (process.argv.indexOf("--no-fail") < 0) {
|
||||
throw msg
|
||||
if (missingLicenses.length > 0) {
|
||||
const msg = `There are ${missingLicenses.length} licenses missing and ${invalidLicenses.length} invalid licenses.`
|
||||
console.log(missingLicenses.concat(invalidLicenses).join("\n"))
|
||||
console.error(msg)
|
||||
if (args.indexOf("--no-fail") < 0) {
|
||||
throw msg
|
||||
}
|
||||
}
|
||||
|
||||
cleanLicenseInfo(licensePaths, licenseInfos)
|
||||
createFullLicenseOverview(licensePaths)
|
||||
}
|
||||
|
||||
cleanLicenseInfo(licensePaths, licenseInfos)
|
||||
createFullLicenseOverview(licensePaths)
|
||||
main(process.argv.slice(2))
|
||||
|
|
|
@ -11,6 +11,7 @@ import {ExtractImages} from "../../../../Models/ThemeConfig/Conversion/FixImages
|
|||
import * as cyclofix from "../../../../assets/generated/themes/cyclofix.json"
|
||||
import {Tag} from "../../../../Logic/Tags/Tag";
|
||||
import {DesugaringContext} from "../../../../Models/ThemeConfig/Conversion/Conversion";
|
||||
import {And} from "../../../../Logic/Tags/And";
|
||||
|
||||
|
||||
const themeConfigJson: LayoutConfigJson = {
|
||||
|
@ -52,7 +53,7 @@ describe("PrepareTheme", () => {
|
|||
let themeConfigJsonPrepared = prepareStep.convert(theme, "test").result
|
||||
const themeConfig = new LayoutConfig(themeConfigJsonPrepared);
|
||||
const layerUnderTest = <LayerConfig> themeConfig.layers.find(l => l.id === "public_bookcase")
|
||||
expect(layerUnderTest.source.osmTags).deep.eq(new Tag("amenity","public_bookcase"))
|
||||
expect(layerUnderTest.source.osmTags).deep.eq(new And([new Tag("amenity","public_bookcase")]))
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
import {describe} from 'mocha'
|
||||
import {expect} from 'chai'
|
||||
import Translations from "../../UI/i18n/Translations";
|
||||
import ValidatedTextField from "../../UI/Input/ValidatedTextField";
|
||||
import {fail} from "assert";
|
||||
import Translations from "../../UI/i18n/Translations";
|
||||
|
||||
describe("ValidatedTextFields", () => {
|
||||
|
||||
it("should all have description in the translations", () => {
|
||||
const ts = Translations.t.validation;
|
||||
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
|
||||
.filter(key => ts[key] === undefined || ts[key].description === undefined)
|
||||
expect(missingTranslations, "These validated text fields don't have a type name defined in en.json. (Did you just add one? Run `npm run generate:translations`)").to.be.empty
|
||||
})
|
||||
it("should all have description in the translations", () => {
|
||||
const ts = Translations.t.validation;
|
||||
const missingTranslations = Array.from(ValidatedTextField.allTypes.keys())
|
||||
.filter(key => ts[key] === undefined || ts[key].description === undefined)
|
||||
.filter(key => key !== "distance")
|
||||
if (missingTranslations.length > 0) {
|
||||
fail("The validated text fields don't have a description defined in en.json for "+missingTranslations.join(", ")+". (Did you just add one? Run `npm run generate:translations`)")
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|