forked from MapComplete/MapComplete
Studio: first working version for basic layer properties
This commit is contained in:
parent
5a49677d5a
commit
f18a2b9184
41 changed files with 4446 additions and 852 deletions
|
@ -1,6 +1,10 @@
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"neededChangesets": {
|
||||||
|
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.\n\ntype: nat\nquestion: How many changesets must a contributor have before being allowed to delete a point?",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"extraDeleteReasons": {
|
"extraDeleteReasons": {
|
||||||
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -8,10 +12,10 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explanation": {
|
"explanation": {
|
||||||
"description": "The text that will be shown to the user - translatable"
|
"description": "The text that will be shown to the user as option for why this point does not exist anymore.\nNote that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default\n\nquestion: For what extra reason might this feature be removed in real-life?"
|
||||||
},
|
},
|
||||||
"changesetMessage": {
|
"changesetMessage": {
|
||||||
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english",
|
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english\n\nquestion: What should be added to the changeset as delete reason?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -29,10 +33,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore"
|
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore\n\nquestion: What tags should be applied to the object?"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "The human explanation for the options"
|
"description": "The human explanation for the options\n\nquestion: What text should be shown to the contributor for this reason?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -42,7 +46,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"softDeletionTags": {
|
"softDeletionTags": {
|
||||||
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```",
|
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```\n\nquestion: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?\ntype: tag",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -55,12 +59,8 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"neededChangesets": {
|
|
||||||
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"omitDefaultDeleteReasons": {
|
"omitDefaultDeleteReasons": {
|
||||||
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping",
|
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping\n\nquestion: Should the default delete reasons be hidden?\niftrue: Hide the default delete reasons\niffalse: Show the default delete reasons\nifunset: Show the default delete reasons (default behaviour)",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
export default {
|
export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"neededChangesets": {
|
||||||
|
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.\n\ntype: nat\nquestion: How many changesets must a contributor have before being allowed to delete a point?",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"extraDeleteReasons": {
|
"extraDeleteReasons": {
|
||||||
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -8,10 +12,10 @@ export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explanation": {
|
"explanation": {
|
||||||
"description": "The text that will be shown to the user - translatable"
|
"description": "The text that will be shown to the user as option for why this point does not exist anymore.\nNote that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default\n\nquestion: For what extra reason might this feature be removed in real-life?"
|
||||||
},
|
},
|
||||||
"changesetMessage": {
|
"changesetMessage": {
|
||||||
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english",
|
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english\n\nquestion: What should be added to the changeset as delete reason?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -29,10 +33,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore"
|
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore\n\nquestion: What tags should be applied to the object?"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "The human explanation for the options"
|
"description": "The human explanation for the options\n\nquestion: What text should be shown to the contributor for this reason?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -42,7 +46,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"softDeletionTags": {
|
"softDeletionTags": {
|
||||||
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```",
|
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```\n\nquestion: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?\ntype: tag",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -55,12 +59,8 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"neededChangesets": {
|
|
||||||
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"omitDefaultDeleteReasons": {
|
"omitDefaultDeleteReasons": {
|
||||||
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping",
|
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping\n\nquestion: Should the default delete reasons be hidden?\niftrue: Hide the default delete reasons\niffalse: Show the default delete reasons\nifunset: Show the default delete reasons (default behaviour)",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: basic\nquestion: What is the identifier of this layer?",
|
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: Basic\nquestion: What is the identifier of this layer?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: basic\nquestion: What is the name of this layer?",
|
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: Basic\nquestion: What is the name of this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: basic\nquestion: How would you describe the features that are shown on this layer?",
|
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: Basic\nquestion: How would you describe the features that are shown on this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ngroup: basic",
|
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ntypesdefault: 0\ngroup: Basic",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
||||||
},
|
},
|
||||||
"maxCacheAge": {
|
"maxCacheAge": {
|
||||||
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat",
|
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat\ndefault: 30 days",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -85,18 +85,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calculatedTags": {
|
"calculatedTags": {
|
||||||
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\ngroup: advanced",
|
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\nSee the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]\n\ngroup: expert\nquestion: What extra attributes should be calculated with javascript?",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doNotDownload": {
|
|
||||||
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isShown": {
|
"isShown": {
|
||||||
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view.\n\nThe default value is 'yes'\n\ngroup: advanced",
|
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.\n\nquestion: What other tags should features match for being shown?\ngroup: advanced\nifunset: all features which match the 'source'-specification are shown.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -109,20 +105,16 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"forceLoad": {
|
|
||||||
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"minzoom": {
|
"minzoom": {
|
||||||
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: Basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"shownByDefault": {
|
"shownByDefault": {
|
||||||
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)\n\ngroup: advanced",
|
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)\n\nquestion: Should this layer be enabled when opening the map for the first time?\niftrue: the layer is enabled when opening the map\niffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)\ndefault: true\ngroup: advanced",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minzoomVisible": {
|
"minzoomVisible": {
|
||||||
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: advanced",
|
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: expert",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
@ -136,6 +128,10 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"popupInFloatover": {
|
||||||
|
"description": "Question: Should the information for this layer be shown in the sidebar or in a splash screen?\n\nIf set, open the selectedElementView in a floatOver instead of on the right.\n\niftrue: show the infobox in the splashscreen floating over the entire UI\niffalse: show the infobox in a sidebar on the right\ngroup: advanced\ndefault: sidebar",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"titleIcons": {
|
"titleIcons": {
|
||||||
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -192,11 +188,19 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"passAllFeatures": {
|
"passAllFeatures": {
|
||||||
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\n\ngroup: advanced",
|
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\niftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers\niffalse: normal behaviour: don't pass features allong\nquestion: should this layer pass features to the next layers?\ngroup: expert",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"doNotDownload": {
|
||||||
|
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\nThe opposite of `forceLoad`\n\niftrue: Do not attempt to query the data for this layer from overpass/the OSM API\niffalse: download the data as usual\ngroup: expert\nquestion: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?\ndefault: false",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"forceLoad": {
|
||||||
|
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.\nThe opposite of `doNotDownload`\n\nquestion: Should this layer be forcibly loaded?\nifftrue: always download this layer, even if it is disabled\niffalse: only download data for this layer when needed (default)\ndefault: false\ngroup: expert",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: basic",
|
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: presets",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -238,18 +242,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snapToLayer": {
|
"snapToLayer": {
|
||||||
"description": "If specified, these layers will be shown to and the new point will be snapped towards it",
|
"description": "question: Should the created point be snapped to a line layer?\n\nIf specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.\nFor example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)\nor to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.\n\nsuggestions: return Array.from(layers.keys()).map(key => ({if: \"value=\"+key, then: key+\" - \"+layers.get(key).description}))",
|
||||||
"anyOf": [
|
"type": "array",
|
||||||
{
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"maxSnapDistance": {
|
"maxSnapDistance": {
|
||||||
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
||||||
|
@ -352,7 +349,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"deletion": {
|
"deletion": {
|
||||||
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n The delete dialog\n =================\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n#### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing",
|
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n### The delete dialog\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n##### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing\ntypes: use an advanced delete configuration ; boolean\niftrue: Allow deletion\niffalse: Do not allow deletion",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/DeleteConfigJson"
|
"$ref": "#/definitions/DeleteConfigJson"
|
||||||
|
@ -363,7 +360,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowMove": {
|
"allowMove": {
|
||||||
"description": "Indicates if a point can be moved and configures the modalities.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\nOff by default. Can be enabled by setting this flag or by configuring.\n\ngroup: editing",
|
"description": "Indicates if a point can be moved and why.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\ntypes: use an advanced move configuration ; boolean\ngroup: editing\nquestion: Is deleting a point allowed?\niftrue: Allow contributors to move a point (for accuracy or a relocation)\niffalse: Don't allow contributors to move points\nifunset: Don't allow contributors to move points (default)",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/default_3"
|
"$ref": "#/definitions/default_3"
|
||||||
|
@ -374,7 +371,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowSplit": {
|
"allowSplit": {
|
||||||
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\n\ngroup: editing",
|
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\nquestion: Should the contributor be able to split ways using this layer?\niftrue: enable the 'split-roads'-component\niffalse: don't enable the split-roads componenet\nifunset: don't enable the split-roads component\ngroup: editing",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
|
@ -384,7 +381,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syncSelection": {
|
"syncSelection": {
|
||||||
"description": "If set, synchronizes whether or not this layer is enabled.\n\nno: Do not sync at all, always revert to default\nlocal: keep selection on local storage\ntheme-only: sync via OSM, but this layer will only be toggled in this theme\nglobal: all layers with this ID will be synced accross all themes\n\ngroup: advanced",
|
"description": "If set, synchronizes whether or not this layer is enabled.\n\ngroup: advanced\nquestion: Should enabling/disabling the layer be saved (locally or in the cloud)?\nsuggestions: return [{if: \"value=no\", then: \"Don't save, always revert to the default\"}, {if: \"value=local\", then: \"Save selection in local storage\"}, {if: \"value=theme-only\", then: \"Save the state in the OSM-usersettings, but apply on this theme only (default)\"}, {if: \"value=global\", then: \"Save in OSM-usersettings and toggle on _all_ themes using this layer\"}]",
|
||||||
"enum": [
|
"enum": [
|
||||||
"global",
|
"global",
|
||||||
"local",
|
"local",
|
||||||
|
@ -394,13 +391,9 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: special",
|
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: hidden",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"popupInFloatover": {
|
|
||||||
"description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"fullNodeDatabase": {
|
"fullNodeDatabase": {
|
||||||
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -790,7 +783,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -1623,6 +1616,10 @@
|
||||||
"DeleteConfigJson": {
|
"DeleteConfigJson": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"neededChangesets": {
|
||||||
|
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.\n\ntype: nat\nquestion: How many changesets must a contributor have before being allowed to delete a point?",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"extraDeleteReasons": {
|
"extraDeleteReasons": {
|
||||||
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -1630,10 +1627,10 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explanation": {
|
"explanation": {
|
||||||
"description": "The text that will be shown to the user - translatable"
|
"description": "The text that will be shown to the user as option for why this point does not exist anymore.\nNote that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default\n\nquestion: For what extra reason might this feature be removed in real-life?"
|
||||||
},
|
},
|
||||||
"changesetMessage": {
|
"changesetMessage": {
|
||||||
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english",
|
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english\n\nquestion: What should be added to the changeset as delete reason?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1651,10 +1648,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore"
|
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore\n\nquestion: What tags should be applied to the object?"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "The human explanation for the options"
|
"description": "The human explanation for the options\n\nquestion: What text should be shown to the contributor for this reason?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1664,7 +1661,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"softDeletionTags": {
|
"softDeletionTags": {
|
||||||
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```",
|
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```\n\nquestion: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?\ntype: tag",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1677,12 +1674,8 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"neededChangesets": {
|
|
||||||
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"omitDefaultDeleteReasons": {
|
"omitDefaultDeleteReasons": {
|
||||||
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping",
|
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping\n\nquestion: Should the default delete reasons be hidden?\niftrue: Hide the default delete reasons\niffalse: Show the default delete reasons\nifunset: Show the default delete reasons (default behaviour)",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,11 +3,11 @@ export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: basic\nquestion: What is the identifier of this layer?",
|
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: Basic\nquestion: What is the identifier of this layer?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: basic\nquestion: What is the name of this layer?",
|
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: Basic\nquestion: What is the name of this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -18,7 +18,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: basic\nquestion: How would you describe the features that are shown on this layer?",
|
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: Basic\nquestion: How would you describe the features that are shown on this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -29,7 +29,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ngroup: basic",
|
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ntypesdefault: 0\ngroup: Basic",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -39,7 +39,7 @@ export default {
|
||||||
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
||||||
},
|
},
|
||||||
"maxCacheAge": {
|
"maxCacheAge": {
|
||||||
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat",
|
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat\ndefault: 30 days",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -85,18 +85,14 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calculatedTags": {
|
"calculatedTags": {
|
||||||
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\ngroup: advanced",
|
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\nSee the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]\n\ngroup: expert\nquestion: What extra attributes should be calculated with javascript?",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doNotDownload": {
|
|
||||||
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isShown": {
|
"isShown": {
|
||||||
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view.\n\nThe default value is 'yes'\n\ngroup: advanced",
|
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.\n\nquestion: What other tags should features match for being shown?\ngroup: advanced\nifunset: all features which match the 'source'-specification are shown.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -109,20 +105,16 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"forceLoad": {
|
|
||||||
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"minzoom": {
|
"minzoom": {
|
||||||
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: Basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"shownByDefault": {
|
"shownByDefault": {
|
||||||
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)\n\ngroup: advanced",
|
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)\n\nquestion: Should this layer be enabled when opening the map for the first time?\niftrue: the layer is enabled when opening the map\niffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)\ndefault: true\ngroup: advanced",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minzoomVisible": {
|
"minzoomVisible": {
|
||||||
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: advanced",
|
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: expert",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
@ -136,6 +128,10 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"popupInFloatover": {
|
||||||
|
"description": "Question: Should the information for this layer be shown in the sidebar or in a splash screen?\n\nIf set, open the selectedElementView in a floatOver instead of on the right.\n\niftrue: show the infobox in the splashscreen floating over the entire UI\niffalse: show the infobox in a sidebar on the right\ngroup: advanced\ndefault: sidebar",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"titleIcons": {
|
"titleIcons": {
|
||||||
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -192,11 +188,19 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"passAllFeatures": {
|
"passAllFeatures": {
|
||||||
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\n\ngroup: advanced",
|
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\niftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers\niffalse: normal behaviour: don't pass features allong\nquestion: should this layer pass features to the next layers?\ngroup: expert",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"doNotDownload": {
|
||||||
|
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\nThe opposite of `forceLoad`\n\niftrue: Do not attempt to query the data for this layer from overpass/the OSM API\niffalse: download the data as usual\ngroup: expert\nquestion: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?\ndefault: false",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"forceLoad": {
|
||||||
|
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.\nThe opposite of `doNotDownload`\n\nquestion: Should this layer be forcibly loaded?\nifftrue: always download this layer, even if it is disabled\niffalse: only download data for this layer when needed (default)\ndefault: false\ngroup: expert",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: basic",
|
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: presets",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -238,18 +242,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snapToLayer": {
|
"snapToLayer": {
|
||||||
"description": "If specified, these layers will be shown to and the new point will be snapped towards it",
|
"description": "question: Should the created point be snapped to a line layer?\n\nIf specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.\nFor example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)\nor to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.\n\nsuggestions: return Array.from(layers.keys()).map(key => ({if: \"value=\"+key, then: key+\" - \"+layers.get(key).description}))",
|
||||||
"anyOf": [
|
"type": "array",
|
||||||
{
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"maxSnapDistance": {
|
"maxSnapDistance": {
|
||||||
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
||||||
|
@ -352,7 +349,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"deletion": {
|
"deletion": {
|
||||||
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n The delete dialog\n =================\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n#### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing",
|
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n### The delete dialog\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n##### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing\ntypes: use an advanced delete configuration ; boolean\niftrue: Allow deletion\niffalse: Do not allow deletion",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/DeleteConfigJson"
|
"$ref": "#/definitions/DeleteConfigJson"
|
||||||
|
@ -363,7 +360,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowMove": {
|
"allowMove": {
|
||||||
"description": "Indicates if a point can be moved and configures the modalities.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\nOff by default. Can be enabled by setting this flag or by configuring.\n\ngroup: editing",
|
"description": "Indicates if a point can be moved and why.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\ntypes: use an advanced move configuration ; boolean\ngroup: editing\nquestion: Is deleting a point allowed?\niftrue: Allow contributors to move a point (for accuracy or a relocation)\niffalse: Don't allow contributors to move points\nifunset: Don't allow contributors to move points (default)",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/default_3"
|
"$ref": "#/definitions/default_3"
|
||||||
|
@ -374,7 +371,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowSplit": {
|
"allowSplit": {
|
||||||
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\n\ngroup: editing",
|
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\nquestion: Should the contributor be able to split ways using this layer?\niftrue: enable the 'split-roads'-component\niffalse: don't enable the split-roads componenet\nifunset: don't enable the split-roads component\ngroup: editing",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
|
@ -384,7 +381,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syncSelection": {
|
"syncSelection": {
|
||||||
"description": "If set, synchronizes whether or not this layer is enabled.\n\nno: Do not sync at all, always revert to default\nlocal: keep selection on local storage\ntheme-only: sync via OSM, but this layer will only be toggled in this theme\nglobal: all layers with this ID will be synced accross all themes\n\ngroup: advanced",
|
"description": "If set, synchronizes whether or not this layer is enabled.\n\ngroup: advanced\nquestion: Should enabling/disabling the layer be saved (locally or in the cloud)?\nsuggestions: return [{if: \"value=no\", then: \"Don't save, always revert to the default\"}, {if: \"value=local\", then: \"Save selection in local storage\"}, {if: \"value=theme-only\", then: \"Save the state in the OSM-usersettings, but apply on this theme only (default)\"}, {if: \"value=global\", then: \"Save in OSM-usersettings and toggle on _all_ themes using this layer\"}]",
|
||||||
"enum": [
|
"enum": [
|
||||||
"global",
|
"global",
|
||||||
"local",
|
"local",
|
||||||
|
@ -394,13 +391,9 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: special",
|
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: hidden",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"popupInFloatover": {
|
|
||||||
"description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"fullNodeDatabase": {
|
"fullNodeDatabase": {
|
||||||
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -783,7 +776,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -1607,6 +1600,10 @@ export default {
|
||||||
"DeleteConfigJson": {
|
"DeleteConfigJson": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"neededChangesets": {
|
||||||
|
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.\n\ntype: nat\nquestion: How many changesets must a contributor have before being allowed to delete a point?",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"extraDeleteReasons": {
|
"extraDeleteReasons": {
|
||||||
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -1614,10 +1611,10 @@ export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explanation": {
|
"explanation": {
|
||||||
"description": "The text that will be shown to the user - translatable"
|
"description": "The text that will be shown to the user as option for why this point does not exist anymore.\nNote that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default\n\nquestion: For what extra reason might this feature be removed in real-life?"
|
||||||
},
|
},
|
||||||
"changesetMessage": {
|
"changesetMessage": {
|
||||||
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english",
|
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english\n\nquestion: What should be added to the changeset as delete reason?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1635,10 +1632,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore"
|
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore\n\nquestion: What tags should be applied to the object?"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "The human explanation for the options"
|
"description": "The human explanation for the options\n\nquestion: What text should be shown to the contributor for this reason?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1648,7 +1645,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"softDeletionTags": {
|
"softDeletionTags": {
|
||||||
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```",
|
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```\n\nquestion: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?\ntype: tag",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1661,12 +1658,8 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"neededChangesets": {
|
|
||||||
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"omitDefaultDeleteReasons": {
|
"omitDefaultDeleteReasons": {
|
||||||
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping",
|
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping\n\nquestion: Should the default delete reasons be hidden?\niftrue: Hide the default delete reasons\niffalse: Show the default delete reasons\nifunset: Show the default delete reasons (default behaviour)",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -683,7 +683,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -1516,6 +1516,10 @@
|
||||||
"DeleteConfigJson": {
|
"DeleteConfigJson": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"neededChangesets": {
|
||||||
|
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.\n\ntype: nat\nquestion: How many changesets must a contributor have before being allowed to delete a point?",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"extraDeleteReasons": {
|
"extraDeleteReasons": {
|
||||||
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -1523,10 +1527,10 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explanation": {
|
"explanation": {
|
||||||
"description": "The text that will be shown to the user - translatable"
|
"description": "The text that will be shown to the user as option for why this point does not exist anymore.\nNote that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default\n\nquestion: For what extra reason might this feature be removed in real-life?"
|
||||||
},
|
},
|
||||||
"changesetMessage": {
|
"changesetMessage": {
|
||||||
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english",
|
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english\n\nquestion: What should be added to the changeset as delete reason?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1544,10 +1548,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore"
|
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore\n\nquestion: What tags should be applied to the object?"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "The human explanation for the options"
|
"description": "The human explanation for the options\n\nquestion: What text should be shown to the contributor for this reason?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1557,7 +1561,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"softDeletionTags": {
|
"softDeletionTags": {
|
||||||
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```",
|
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```\n\nquestion: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?\ntype: tag",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1570,12 +1574,8 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"neededChangesets": {
|
|
||||||
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"omitDefaultDeleteReasons": {
|
"omitDefaultDeleteReasons": {
|
||||||
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping",
|
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping\n\nquestion: Should the default delete reasons be hidden?\niftrue: Hide the default delete reasons\niffalse: Show the default delete reasons\nifunset: Show the default delete reasons (default behaviour)",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1700,11 +1700,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: basic\nquestion: What is the identifier of this layer?",
|
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: Basic\nquestion: What is the identifier of this layer?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: basic\nquestion: What is the name of this layer?",
|
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: Basic\nquestion: What is the name of this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1715,7 +1715,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: basic\nquestion: How would you describe the features that are shown on this layer?",
|
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: Basic\nquestion: How would you describe the features that are shown on this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1726,7 +1726,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ngroup: basic",
|
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ntypesdefault: 0\ngroup: Basic",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -1736,7 +1736,7 @@
|
||||||
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
||||||
},
|
},
|
||||||
"maxCacheAge": {
|
"maxCacheAge": {
|
||||||
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat",
|
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat\ndefault: 30 days",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1782,18 +1782,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calculatedTags": {
|
"calculatedTags": {
|
||||||
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\ngroup: advanced",
|
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\nSee the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]\n\ngroup: expert\nquestion: What extra attributes should be calculated with javascript?",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doNotDownload": {
|
|
||||||
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isShown": {
|
"isShown": {
|
||||||
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view.\n\nThe default value is 'yes'\n\ngroup: advanced",
|
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.\n\nquestion: What other tags should features match for being shown?\ngroup: advanced\nifunset: all features which match the 'source'-specification are shown.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1806,20 +1802,16 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"forceLoad": {
|
|
||||||
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"minzoom": {
|
"minzoom": {
|
||||||
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: Basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"shownByDefault": {
|
"shownByDefault": {
|
||||||
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)\n\ngroup: advanced",
|
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)\n\nquestion: Should this layer be enabled when opening the map for the first time?\niftrue: the layer is enabled when opening the map\niffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)\ndefault: true\ngroup: advanced",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minzoomVisible": {
|
"minzoomVisible": {
|
||||||
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: advanced",
|
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: expert",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
@ -1833,6 +1825,10 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"popupInFloatover": {
|
||||||
|
"description": "Question: Should the information for this layer be shown in the sidebar or in a splash screen?\n\nIf set, open the selectedElementView in a floatOver instead of on the right.\n\niftrue: show the infobox in the splashscreen floating over the entire UI\niffalse: show the infobox in a sidebar on the right\ngroup: advanced\ndefault: sidebar",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"titleIcons": {
|
"titleIcons": {
|
||||||
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -1889,11 +1885,19 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"passAllFeatures": {
|
"passAllFeatures": {
|
||||||
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\n\ngroup: advanced",
|
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\niftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers\niffalse: normal behaviour: don't pass features allong\nquestion: should this layer pass features to the next layers?\ngroup: expert",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"doNotDownload": {
|
||||||
|
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\nThe opposite of `forceLoad`\n\niftrue: Do not attempt to query the data for this layer from overpass/the OSM API\niffalse: download the data as usual\ngroup: expert\nquestion: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?\ndefault: false",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"forceLoad": {
|
||||||
|
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.\nThe opposite of `doNotDownload`\n\nquestion: Should this layer be forcibly loaded?\nifftrue: always download this layer, even if it is disabled\niffalse: only download data for this layer when needed (default)\ndefault: false\ngroup: expert",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: basic",
|
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: presets",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -1935,18 +1939,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snapToLayer": {
|
"snapToLayer": {
|
||||||
"description": "If specified, these layers will be shown to and the new point will be snapped towards it",
|
"description": "question: Should the created point be snapped to a line layer?\n\nIf specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.\nFor example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)\nor to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.\n\nsuggestions: return Array.from(layers.keys()).map(key => ({if: \"value=\"+key, then: key+\" - \"+layers.get(key).description}))",
|
||||||
"anyOf": [
|
"type": "array",
|
||||||
{
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"maxSnapDistance": {
|
"maxSnapDistance": {
|
||||||
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
||||||
|
@ -2049,7 +2046,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"deletion": {
|
"deletion": {
|
||||||
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n The delete dialog\n =================\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n#### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing",
|
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n### The delete dialog\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n##### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing\ntypes: use an advanced delete configuration ; boolean\niftrue: Allow deletion\niffalse: Do not allow deletion",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/DeleteConfigJson"
|
"$ref": "#/definitions/DeleteConfigJson"
|
||||||
|
@ -2060,7 +2057,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowMove": {
|
"allowMove": {
|
||||||
"description": "Indicates if a point can be moved and configures the modalities.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\nOff by default. Can be enabled by setting this flag or by configuring.\n\ngroup: editing",
|
"description": "Indicates if a point can be moved and why.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\ntypes: use an advanced move configuration ; boolean\ngroup: editing\nquestion: Is deleting a point allowed?\niftrue: Allow contributors to move a point (for accuracy or a relocation)\niffalse: Don't allow contributors to move points\nifunset: Don't allow contributors to move points (default)",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/default_3"
|
"$ref": "#/definitions/default_3"
|
||||||
|
@ -2071,7 +2068,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowSplit": {
|
"allowSplit": {
|
||||||
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\n\ngroup: editing",
|
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\nquestion: Should the contributor be able to split ways using this layer?\niftrue: enable the 'split-roads'-component\niffalse: don't enable the split-roads componenet\nifunset: don't enable the split-roads component\ngroup: editing",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
|
@ -2081,7 +2078,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syncSelection": {
|
"syncSelection": {
|
||||||
"description": "If set, synchronizes whether or not this layer is enabled.\n\nno: Do not sync at all, always revert to default\nlocal: keep selection on local storage\ntheme-only: sync via OSM, but this layer will only be toggled in this theme\nglobal: all layers with this ID will be synced accross all themes\n\ngroup: advanced",
|
"description": "If set, synchronizes whether or not this layer is enabled.\n\ngroup: advanced\nquestion: Should enabling/disabling the layer be saved (locally or in the cloud)?\nsuggestions: return [{if: \"value=no\", then: \"Don't save, always revert to the default\"}, {if: \"value=local\", then: \"Save selection in local storage\"}, {if: \"value=theme-only\", then: \"Save the state in the OSM-usersettings, but apply on this theme only (default)\"}, {if: \"value=global\", then: \"Save in OSM-usersettings and toggle on _all_ themes using this layer\"}]",
|
||||||
"enum": [
|
"enum": [
|
||||||
"global",
|
"global",
|
||||||
"local",
|
"local",
|
||||||
|
@ -2091,13 +2088,9 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: special",
|
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: hidden",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"popupInFloatover": {
|
|
||||||
"description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"fullNodeDatabase": {
|
"fullNodeDatabase": {
|
||||||
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -2114,11 +2107,11 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: basic\nquestion: What is the identifier of this layer?",
|
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: Basic\nquestion: What is the identifier of this layer?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: basic\nquestion: What is the name of this layer?",
|
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: Basic\nquestion: What is the name of this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -2129,7 +2122,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: basic\nquestion: How would you describe the features that are shown on this layer?",
|
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: Basic\nquestion: How would you describe the features that are shown on this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -2140,7 +2133,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ngroup: basic",
|
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ntypesdefault: 0\ngroup: Basic",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -2150,7 +2143,7 @@
|
||||||
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
||||||
},
|
},
|
||||||
"maxCacheAge": {
|
"maxCacheAge": {
|
||||||
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat",
|
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat\ndefault: 30 days",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2196,18 +2189,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calculatedTags": {
|
"calculatedTags": {
|
||||||
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\ngroup: advanced",
|
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\nSee the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]\n\ngroup: expert\nquestion: What extra attributes should be calculated with javascript?",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doNotDownload": {
|
|
||||||
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isShown": {
|
"isShown": {
|
||||||
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view.\n\nThe default value is 'yes'\n\ngroup: advanced",
|
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.\n\nquestion: What other tags should features match for being shown?\ngroup: advanced\nifunset: all features which match the 'source'-specification are shown.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -2220,20 +2209,16 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"forceLoad": {
|
|
||||||
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"minzoom": {
|
"minzoom": {
|
||||||
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: Basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"shownByDefault": {
|
"shownByDefault": {
|
||||||
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)\n\ngroup: advanced",
|
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)\n\nquestion: Should this layer be enabled when opening the map for the first time?\niftrue: the layer is enabled when opening the map\niffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)\ndefault: true\ngroup: advanced",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minzoomVisible": {
|
"minzoomVisible": {
|
||||||
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: advanced",
|
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: expert",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
@ -2247,6 +2232,10 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"popupInFloatover": {
|
||||||
|
"description": "Question: Should the information for this layer be shown in the sidebar or in a splash screen?\n\nIf set, open the selectedElementView in a floatOver instead of on the right.\n\niftrue: show the infobox in the splashscreen floating over the entire UI\niffalse: show the infobox in a sidebar on the right\ngroup: advanced\ndefault: sidebar",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"titleIcons": {
|
"titleIcons": {
|
||||||
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -2303,11 +2292,19 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"passAllFeatures": {
|
"passAllFeatures": {
|
||||||
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\n\ngroup: advanced",
|
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\niftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers\niffalse: normal behaviour: don't pass features allong\nquestion: should this layer pass features to the next layers?\ngroup: expert",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"doNotDownload": {
|
||||||
|
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\nThe opposite of `forceLoad`\n\niftrue: Do not attempt to query the data for this layer from overpass/the OSM API\niffalse: download the data as usual\ngroup: expert\nquestion: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?\ndefault: false",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"forceLoad": {
|
||||||
|
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.\nThe opposite of `doNotDownload`\n\nquestion: Should this layer be forcibly loaded?\nifftrue: always download this layer, even if it is disabled\niffalse: only download data for this layer when needed (default)\ndefault: false\ngroup: expert",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: basic",
|
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: presets",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -2349,18 +2346,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snapToLayer": {
|
"snapToLayer": {
|
||||||
"description": "If specified, these layers will be shown to and the new point will be snapped towards it",
|
"description": "question: Should the created point be snapped to a line layer?\n\nIf specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.\nFor example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)\nor to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.\n\nsuggestions: return Array.from(layers.keys()).map(key => ({if: \"value=\"+key, then: key+\" - \"+layers.get(key).description}))",
|
||||||
"anyOf": [
|
"type": "array",
|
||||||
{
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"maxSnapDistance": {
|
"maxSnapDistance": {
|
||||||
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
||||||
|
@ -2463,7 +2453,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"deletion": {
|
"deletion": {
|
||||||
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n The delete dialog\n =================\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n#### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing",
|
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n### The delete dialog\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n##### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing\ntypes: use an advanced delete configuration ; boolean\niftrue: Allow deletion\niffalse: Do not allow deletion",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/DeleteConfigJson"
|
"$ref": "#/definitions/DeleteConfigJson"
|
||||||
|
@ -2474,7 +2464,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowMove": {
|
"allowMove": {
|
||||||
"description": "Indicates if a point can be moved and configures the modalities.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\nOff by default. Can be enabled by setting this flag or by configuring.\n\ngroup: editing",
|
"description": "Indicates if a point can be moved and why.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\ntypes: use an advanced move configuration ; boolean\ngroup: editing\nquestion: Is deleting a point allowed?\niftrue: Allow contributors to move a point (for accuracy or a relocation)\niffalse: Don't allow contributors to move points\nifunset: Don't allow contributors to move points (default)",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/default_3"
|
"$ref": "#/definitions/default_3"
|
||||||
|
@ -2485,7 +2475,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowSplit": {
|
"allowSplit": {
|
||||||
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\n\ngroup: editing",
|
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\nquestion: Should the contributor be able to split ways using this layer?\niftrue: enable the 'split-roads'-component\niffalse: don't enable the split-roads componenet\nifunset: don't enable the split-roads component\ngroup: editing",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
|
@ -2495,7 +2485,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syncSelection": {
|
"syncSelection": {
|
||||||
"description": "If set, synchronizes whether or not this layer is enabled.\n\nno: Do not sync at all, always revert to default\nlocal: keep selection on local storage\ntheme-only: sync via OSM, but this layer will only be toggled in this theme\nglobal: all layers with this ID will be synced accross all themes\n\ngroup: advanced",
|
"description": "If set, synchronizes whether or not this layer is enabled.\n\ngroup: advanced\nquestion: Should enabling/disabling the layer be saved (locally or in the cloud)?\nsuggestions: return [{if: \"value=no\", then: \"Don't save, always revert to the default\"}, {if: \"value=local\", then: \"Save selection in local storage\"}, {if: \"value=theme-only\", then: \"Save the state in the OSM-usersettings, but apply on this theme only (default)\"}, {if: \"value=global\", then: \"Save in OSM-usersettings and toggle on _all_ themes using this layer\"}]",
|
||||||
"enum": [
|
"enum": [
|
||||||
"global",
|
"global",
|
||||||
"local",
|
"local",
|
||||||
|
@ -2505,13 +2495,9 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: special",
|
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: hidden",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"popupInFloatover": {
|
|
||||||
"description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"fullNodeDatabase": {
|
"fullNodeDatabase": {
|
||||||
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
|
|
@ -676,7 +676,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -1500,6 +1500,10 @@ export default {
|
||||||
"DeleteConfigJson": {
|
"DeleteConfigJson": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"neededChangesets": {
|
||||||
|
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.\n\ntype: nat\nquestion: How many changesets must a contributor have before being allowed to delete a point?",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"extraDeleteReasons": {
|
"extraDeleteReasons": {
|
||||||
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
"description": "*\nBy default, three reasons to delete a point are shown:\n\n- The point does not exist anymore\n- The point was a testing point\n- THe point could not be found\n\nHowever, for some layers, there might be different or more specific reasons for deletion which can be user friendly to set, e.g.:\n\n- the shop has closed\n- the climbing route has been closed of for nature conservation reasons\n- ...\n\nThese reasons can be stated here and will be shown in the list of options the user can choose from",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
@ -1507,10 +1511,10 @@ export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explanation": {
|
"explanation": {
|
||||||
"description": "The text that will be shown to the user - translatable"
|
"description": "The text that will be shown to the user as option for why this point does not exist anymore.\nNote that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default\n\nquestion: For what extra reason might this feature be removed in real-life?"
|
||||||
},
|
},
|
||||||
"changesetMessage": {
|
"changesetMessage": {
|
||||||
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english",
|
"description": "The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion\nShould be a few words, in english\n\nquestion: What should be added to the changeset as delete reason?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1528,10 +1532,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore"
|
"description": "The tags that will be given to the object.\nThis must remove tags so that the 'source/osmTags' won't match anymore\n\nquestion: What tags should be applied to the object?"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "The human explanation for the options"
|
"description": "The human explanation for the options\n\nquestion: What text should be shown to the contributor for this reason?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1541,7 +1545,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"softDeletionTags": {
|
"softDeletionTags": {
|
||||||
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```",
|
"description": "In some cases, the contributor is not allowed to delete the current feature (e.g. because it isn't a point, the point is referenced by a relation or the user isn't experienced enough).\nTo still offer the user a 'delete'-option, the feature is retagged with these tags. This is a soft deletion, as the point isn't actually removed from OSM but rather marked as 'disused'\nIt is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!\n\nExample (note that \"amenity=\" erases the 'amenity'-key alltogether):\n\n```\n{\n \"and\": [\"disussed:amenity=public_bookcase\", \"amenity=\"]\n}\n```\n\nor (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):\n\n```\n{\n \"and\": [\"disused:shop:={shop}\", \"shop=\"]\n}\n```\n\nquestion: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?\ntype: tag",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1554,12 +1558,8 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"neededChangesets": {
|
|
||||||
"description": "*\nBy default, the contributor needs 20 previous changesets to delete points edited by others.\nFor some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"omitDefaultDeleteReasons": {
|
"omitDefaultDeleteReasons": {
|
||||||
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping",
|
"description": "Set this flag if the default delete reasons should be omitted from the dialog.\nThis requires at least one extraDeleteReason or nonDeleteMapping\n\nquestion: Should the default delete reasons be hidden?\niftrue: Hide the default delete reasons\niffalse: Show the default delete reasons\nifunset: Show the default delete reasons (default behaviour)",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1679,11 +1679,11 @@ export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: basic\nquestion: What is the identifier of this layer?",
|
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: Basic\nquestion: What is the identifier of this layer?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: basic\nquestion: What is the name of this layer?",
|
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: Basic\nquestion: What is the name of this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1694,7 +1694,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: basic\nquestion: How would you describe the features that are shown on this layer?",
|
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: Basic\nquestion: How would you describe the features that are shown on this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1705,7 +1705,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ngroup: basic",
|
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ntypesdefault: 0\ngroup: Basic",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -1715,7 +1715,7 @@ export default {
|
||||||
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
||||||
},
|
},
|
||||||
"maxCacheAge": {
|
"maxCacheAge": {
|
||||||
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat",
|
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat\ndefault: 30 days",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1761,18 +1761,14 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calculatedTags": {
|
"calculatedTags": {
|
||||||
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\ngroup: advanced",
|
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\nSee the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]\n\ngroup: expert\nquestion: What extra attributes should be calculated with javascript?",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doNotDownload": {
|
|
||||||
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isShown": {
|
"isShown": {
|
||||||
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view.\n\nThe default value is 'yes'\n\ngroup: advanced",
|
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.\n\nquestion: What other tags should features match for being shown?\ngroup: advanced\nifunset: all features which match the 'source'-specification are shown.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1785,20 +1781,16 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"forceLoad": {
|
|
||||||
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"minzoom": {
|
"minzoom": {
|
||||||
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: Basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"shownByDefault": {
|
"shownByDefault": {
|
||||||
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)\n\ngroup: advanced",
|
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)\n\nquestion: Should this layer be enabled when opening the map for the first time?\niftrue: the layer is enabled when opening the map\niffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)\ndefault: true\ngroup: advanced",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minzoomVisible": {
|
"minzoomVisible": {
|
||||||
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: advanced",
|
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: expert",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
@ -1812,6 +1804,10 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"popupInFloatover": {
|
||||||
|
"description": "Question: Should the information for this layer be shown in the sidebar or in a splash screen?\n\nIf set, open the selectedElementView in a floatOver instead of on the right.\n\niftrue: show the infobox in the splashscreen floating over the entire UI\niffalse: show the infobox in a sidebar on the right\ngroup: advanced\ndefault: sidebar",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"titleIcons": {
|
"titleIcons": {
|
||||||
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -1868,11 +1864,19 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"passAllFeatures": {
|
"passAllFeatures": {
|
||||||
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\n\ngroup: advanced",
|
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\niftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers\niffalse: normal behaviour: don't pass features allong\nquestion: should this layer pass features to the next layers?\ngroup: expert",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"doNotDownload": {
|
||||||
|
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\nThe opposite of `forceLoad`\n\niftrue: Do not attempt to query the data for this layer from overpass/the OSM API\niffalse: download the data as usual\ngroup: expert\nquestion: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?\ndefault: false",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"forceLoad": {
|
||||||
|
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.\nThe opposite of `doNotDownload`\n\nquestion: Should this layer be forcibly loaded?\nifftrue: always download this layer, even if it is disabled\niffalse: only download data for this layer when needed (default)\ndefault: false\ngroup: expert",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: basic",
|
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: presets",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -1914,18 +1918,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snapToLayer": {
|
"snapToLayer": {
|
||||||
"description": "If specified, these layers will be shown to and the new point will be snapped towards it",
|
"description": "question: Should the created point be snapped to a line layer?\n\nIf specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.\nFor example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)\nor to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.\n\nsuggestions: return Array.from(layers.keys()).map(key => ({if: \"value=\"+key, then: key+\" - \"+layers.get(key).description}))",
|
||||||
"anyOf": [
|
"type": "array",
|
||||||
{
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"maxSnapDistance": {
|
"maxSnapDistance": {
|
||||||
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
||||||
|
@ -2028,7 +2025,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"deletion": {
|
"deletion": {
|
||||||
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n The delete dialog\n =================\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n#### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing",
|
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n### The delete dialog\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n##### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing\ntypes: use an advanced delete configuration ; boolean\niftrue: Allow deletion\niffalse: Do not allow deletion",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/DeleteConfigJson"
|
"$ref": "#/definitions/DeleteConfigJson"
|
||||||
|
@ -2039,7 +2036,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowMove": {
|
"allowMove": {
|
||||||
"description": "Indicates if a point can be moved and configures the modalities.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\nOff by default. Can be enabled by setting this flag or by configuring.\n\ngroup: editing",
|
"description": "Indicates if a point can be moved and why.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\ntypes: use an advanced move configuration ; boolean\ngroup: editing\nquestion: Is deleting a point allowed?\niftrue: Allow contributors to move a point (for accuracy or a relocation)\niffalse: Don't allow contributors to move points\nifunset: Don't allow contributors to move points (default)",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/default_3"
|
"$ref": "#/definitions/default_3"
|
||||||
|
@ -2050,7 +2047,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowSplit": {
|
"allowSplit": {
|
||||||
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\n\ngroup: editing",
|
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\nquestion: Should the contributor be able to split ways using this layer?\niftrue: enable the 'split-roads'-component\niffalse: don't enable the split-roads componenet\nifunset: don't enable the split-roads component\ngroup: editing",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
|
@ -2060,7 +2057,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syncSelection": {
|
"syncSelection": {
|
||||||
"description": "If set, synchronizes whether or not this layer is enabled.\n\nno: Do not sync at all, always revert to default\nlocal: keep selection on local storage\ntheme-only: sync via OSM, but this layer will only be toggled in this theme\nglobal: all layers with this ID will be synced accross all themes\n\ngroup: advanced",
|
"description": "If set, synchronizes whether or not this layer is enabled.\n\ngroup: advanced\nquestion: Should enabling/disabling the layer be saved (locally or in the cloud)?\nsuggestions: return [{if: \"value=no\", then: \"Don't save, always revert to the default\"}, {if: \"value=local\", then: \"Save selection in local storage\"}, {if: \"value=theme-only\", then: \"Save the state in the OSM-usersettings, but apply on this theme only (default)\"}, {if: \"value=global\", then: \"Save in OSM-usersettings and toggle on _all_ themes using this layer\"}]",
|
||||||
"enum": [
|
"enum": [
|
||||||
"global",
|
"global",
|
||||||
"local",
|
"local",
|
||||||
|
@ -2070,13 +2067,9 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: special",
|
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: hidden",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"popupInFloatover": {
|
|
||||||
"description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"fullNodeDatabase": {
|
"fullNodeDatabase": {
|
||||||
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -2092,11 +2085,11 @@ export default {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: basic\nquestion: What is the identifier of this layer?",
|
"description": "The id of this layer.\nThis should be a simple, lowercase, human readable string that is used to identify the layer.\n\ngroup: Basic\nquestion: What is the identifier of this layer?",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: basic\nquestion: What is the name of this layer?",
|
"description": "Used in the layer control panel to toggle a layer on and of.\n\nifunset: This will hide the layer in the layer control, making it not filterable and not toggleable\n\ngroup: Basic\nquestion: What is the name of this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -2107,7 +2100,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: basic\nquestion: How would you describe the features that are shown on this layer?",
|
"description": "A description for the features shown in this layer.\nThis often resembles the introduction of the wiki.osm.org-page for this feature.\n\ngroup: Basic\nquestion: How would you describe the features that are shown on this layer?",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -2118,7 +2111,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ngroup: basic",
|
"description": "Question: Where should the data be fetched from?\n\nThis determines where the data for the layer is fetched: from OSM or from an external geojson dataset.\n\nIf no 'geojson' is defined, data will be fetched from overpass and the OSM-API.\n\nEvery source _must_ define which tags _must_ be present in order to be picked up.\n\nNote: a source must always be defined. 'special' is only allowed if this is a builtin-layer\n\ntypes: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;\ntypesdefault: 0\ngroup: Basic",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -2128,7 +2121,7 @@ export default {
|
||||||
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
"description": "question: Which tags must be present on the feature to show it in this layer?\n\n Every source must set which tags have to be present in order to load the given layer."
|
||||||
},
|
},
|
||||||
"maxCacheAge": {
|
"maxCacheAge": {
|
||||||
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat",
|
"description": "question: How long (in seconds) is the data allowed to remain cached until it must be refreshed?\nThe maximum amount of seconds that a tile is allowed to linger in the cache\n\ntype: nat\ndefault: 30 days",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2174,18 +2167,14 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calculatedTags": {
|
"calculatedTags": {
|
||||||
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\ngroup: advanced",
|
"description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to <a>Docs/CalculatedTags.md</a> for more information\nThe functions will be run in order, e.g.\n[\n \"_max_overlap_m2=Math.max(...feat.overlapsWith(\"someOtherLayer\").map(o => o.overlap))\n \"_max_overlap_ratio=Number(feat._max_overlap_m2)/feat.area\n]\n\nThe specified tags are evaluated lazily. E.g. if a calculated tag is only used in the popup (e.g. the number of nearby features),\nthe expensive calculation will only be performed then for that feature. This avoids clogging up the contributors PC when all features are loaded.\n\nIf a tag has to be evaluated strictly, use ':=' instead:\n\n[\n\"_some_key:=some_javascript_expression\"\n]\n\nSee the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]\n\ngroup: expert\nquestion: What extra attributes should be calculated with javascript?",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doNotDownload": {
|
|
||||||
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isShown": {
|
"isShown": {
|
||||||
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view.\n\nThe default value is 'yes'\n\ngroup: advanced",
|
"description": "If set, only features matching this extra tag will be shown.\nThis is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.\n\nquestion: What other tags should features match for being shown?\ngroup: advanced\nifunset: all features which match the 'source'-specification are shown.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -2198,20 +2187,16 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"forceLoad": {
|
|
||||||
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"minzoom": {
|
"minzoom": {
|
||||||
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
"description": "The minimum needed zoomlevel required to start loading and displaying the data.\nThis can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).\nThis prevents cluttering the map with thousands of parkings if one is looking to an entire city.\n\nDefault: 0\ngroup: Basic\ntype: nat\nquestion: At what zoom level should features of the layer be shown?\nifunset: Always load this layer, even if the entire world is in view.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"shownByDefault": {
|
"shownByDefault": {
|
||||||
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)\n\ngroup: advanced",
|
"description": "Indicates if this layer is shown by default;\ncan be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)\n\nquestion: Should this layer be enabled when opening the map for the first time?\niftrue: the layer is enabled when opening the map\niffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)\ndefault: true\ngroup: advanced",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"minzoomVisible": {
|
"minzoomVisible": {
|
||||||
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: advanced",
|
"description": "The zoom level at which point the data is hidden again\nDefault: 100 (thus: always visible\n\ngroup: expert",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
|
@ -2225,6 +2210,10 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"popupInFloatover": {
|
||||||
|
"description": "Question: Should the information for this layer be shown in the sidebar or in a splash screen?\n\nIf set, open the selectedElementView in a floatOver instead of on the right.\n\niftrue: show the infobox in the splashscreen floating over the entire UI\niffalse: show the infobox in a sidebar on the right\ngroup: advanced\ndefault: sidebar",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"titleIcons": {
|
"titleIcons": {
|
||||||
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
"description": "Small icons shown next to the title.\nIf not specified, the OsmLink and wikipedia links will be used by default.\nUse an empty array to hide them.\nNote that \"defaults\" will insert all the default titleIcons (which are added automatically)\n\nType: icon[]\ngroup: infobox",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
@ -2281,11 +2270,19 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"passAllFeatures": {
|
"passAllFeatures": {
|
||||||
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\n\ngroup: advanced",
|
"description": "If set, this layer will pass all the features it receives onto the next layer.\nThis is ideal for decoration, e.g. directions on cameras\niftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers\niffalse: normal behaviour: don't pass features allong\nquestion: should this layer pass features to the next layers?\ngroup: expert",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"doNotDownload": {
|
||||||
|
"description": "If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.\nWorks well together with 'passAllFeatures', to add decoration\nThe opposite of `forceLoad`\n\niftrue: Do not attempt to query the data for this layer from overpass/the OSM API\niffalse: download the data as usual\ngroup: expert\nquestion: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?\ndefault: false",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"forceLoad": {
|
||||||
|
"description": "Advanced option - might be set by the theme compiler\n\nIf true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.\nThe opposite of `doNotDownload`\n\nquestion: Should this layer be forcibly loaded?\nifftrue: always download this layer, even if it is disabled\niffalse: only download data for this layer when needed (default)\ndefault: false\ngroup: expert",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"presets": {
|
"presets": {
|
||||||
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: basic",
|
"description": "Presets for this layer.\nA preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);\nit will prompt the user to add a new point.\n\nThe most important aspect are the tags, which define which tags the new point will have;\nThe title is shown in the dialog, along with the first sentence of the description.\n\nUpon confirmation, the full description is shown beneath the buttons - perfect to add pictures and examples.\n\nNote: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!\nNB: if no presets are defined, the popup to add new points doesn't show up at all\n\ngroup: presets",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -2327,18 +2324,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snapToLayer": {
|
"snapToLayer": {
|
||||||
"description": "If specified, these layers will be shown to and the new point will be snapped towards it",
|
"description": "question: Should the created point be snapped to a line layer?\n\nIf specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.\nFor example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)\nor to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.\n\nsuggestions: return Array.from(layers.keys()).map(key => ({if: \"value=\"+key, then: key+\" - \"+layers.get(key).description}))",
|
||||||
"anyOf": [
|
"type": "array",
|
||||||
{
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"maxSnapDistance": {
|
"maxSnapDistance": {
|
||||||
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
"description": "If specified, a new point will only be snapped if it is within this range.\nDistance in meter\n\nDefault: 10",
|
||||||
|
@ -2441,7 +2431,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"deletion": {
|
"deletion": {
|
||||||
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n The delete dialog\n =================\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n#### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing",
|
"description": "This block defines under what circumstances the delete dialog is shown for objects of this layer.\nIf set, a dialog is shown to the user to (soft) delete the point.\nThe dialog is built to be user friendly and to prevent mistakes.\nIf deletion is not possible, the dialog will hide itself and show the reason of non-deletability instead.\n\nTo configure, the following values are possible:\n\n- false: never ever show the delete button\n- true: show the default delete button\n- undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future\n- or: a hash with options (see below)\n\n### The delete dialog\n\n\n\n#### Hard deletion if enough experience\n\nA feature can only be deleted from OpenStreetMap by mapcomplete if:\n\n- It is a node\n- No ways or relations use the node\n- The logged-in user has enough experience OR the user is the only one to have edited the point previously\n- The logged-in user has no unread messages (or has a ton of experience)\n- The user did not select one of the 'non-delete-options' (see below)\n\nIn all other cases, a 'soft deletion' is used.\n\n#### Soft deletion\n\nA 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.\nThis makes it look like it was deleted, without doing damage. A fixme will be added to the point.\n\nNote that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme\n\n##### No-delete options\n\nIn some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed \"because the path is on their private property\").\nHowever, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice \"hey, there is a path missing here! Let me redraw it in OSM!)\n\nThe correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.\nA no-delete option is offered as 'reason to delete it', but secretly retags.\n\ngroup: editing\ntypes: use an advanced delete configuration ; boolean\niftrue: Allow deletion\niffalse: Do not allow deletion",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/DeleteConfigJson"
|
"$ref": "#/definitions/DeleteConfigJson"
|
||||||
|
@ -2452,7 +2442,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowMove": {
|
"allowMove": {
|
||||||
"description": "Indicates if a point can be moved and configures the modalities.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\nOff by default. Can be enabled by setting this flag or by configuring.\n\ngroup: editing",
|
"description": "Indicates if a point can be moved and why.\n\nA feature can be moved by MapComplete if:\n\n- It is a point\n- The point is _not_ part of a way or a a relation.\n\ntypes: use an advanced move configuration ; boolean\ngroup: editing\nquestion: Is deleting a point allowed?\niftrue: Allow contributors to move a point (for accuracy or a relocation)\niffalse: Don't allow contributors to move points\nifunset: Don't allow contributors to move points (default)",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/default_3"
|
"$ref": "#/definitions/default_3"
|
||||||
|
@ -2463,7 +2453,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allowSplit": {
|
"allowSplit": {
|
||||||
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\n\ngroup: editing",
|
"description": "If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.\n\nIf the way is part of a relation, MapComplete will attempt to update this relation as well\nquestion: Should the contributor be able to split ways using this layer?\niftrue: enable the 'split-roads'-component\niffalse: don't enable the split-roads componenet\nifunset: don't enable the split-roads component\ngroup: editing",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
|
@ -2473,7 +2463,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syncSelection": {
|
"syncSelection": {
|
||||||
"description": "If set, synchronizes whether or not this layer is enabled.\n\nno: Do not sync at all, always revert to default\nlocal: keep selection on local storage\ntheme-only: sync via OSM, but this layer will only be toggled in this theme\nglobal: all layers with this ID will be synced accross all themes\n\ngroup: advanced",
|
"description": "If set, synchronizes whether or not this layer is enabled.\n\ngroup: advanced\nquestion: Should enabling/disabling the layer be saved (locally or in the cloud)?\nsuggestions: return [{if: \"value=no\", then: \"Don't save, always revert to the default\"}, {if: \"value=local\", then: \"Save selection in local storage\"}, {if: \"value=theme-only\", then: \"Save the state in the OSM-usersettings, but apply on this theme only (default)\"}, {if: \"value=global\", then: \"Save in OSM-usersettings and toggle on _all_ themes using this layer\"}]",
|
||||||
"enum": [
|
"enum": [
|
||||||
"global",
|
"global",
|
||||||
"local",
|
"local",
|
||||||
|
@ -2483,13 +2473,9 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: special",
|
"description": "Used for comments and/or to disable some checks\n\nno-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering\n\ngroup: hidden",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"popupInFloatover": {
|
|
||||||
"description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"fullNodeDatabase": {
|
"fullNodeDatabase": {
|
||||||
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
"description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -72,7 +72,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -555,7 +555,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -548,7 +548,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -411,7 +411,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -404,7 +404,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"addExtraTags": {
|
"addExtraTags": {
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```",
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -39,8 +39,9 @@ export class ExtractImages extends Conversion<
|
||||||
return (
|
return (
|
||||||
metapath.type?.some(
|
metapath.type?.some(
|
||||||
(t) =>
|
(t) =>
|
||||||
t["$ref"] == "#/definitions/TagRenderingConfigJson" ||
|
t !== null &&
|
||||||
t["$ref"] == "#/definitions/QuestionableTagRenderingConfigJson"
|
(t["$ref"] == "#/definitions/TagRenderingConfigJson" ||
|
||||||
|
t["$ref"] == "#/definitions/QuestionableTagRenderingConfigJson")
|
||||||
) ?? false
|
) ?? false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,10 @@ export class UpdateLegacyLayer extends DesugaringStep<
|
||||||
delete preset["preciseInput"]
|
delete preset["preciseInput"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof preset.snapToLayer === "string") {
|
||||||
|
preset.snapToLayer = [preset.snapToLayer]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.tagRenderings !== undefined) {
|
if (config.tagRenderings !== undefined) {
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
import { TagConfigJson } from "./TagConfigJson"
|
import { TagConfigJson } from "./TagConfigJson"
|
||||||
|
|
||||||
export interface DeleteConfigJson {
|
export interface DeleteConfigJson {
|
||||||
|
/***
|
||||||
|
* By default, the contributor needs 20 previous changesets to delete points edited by others.
|
||||||
|
* For some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.
|
||||||
|
*
|
||||||
|
* type: nat
|
||||||
|
* question: How many changesets must a contributor have before being allowed to delete a point?
|
||||||
|
*/
|
||||||
|
neededChangesets?: number
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* By default, three reasons to delete a point are shown:
|
* By default, three reasons to delete a point are shown:
|
||||||
*
|
*
|
||||||
|
@ -18,12 +27,17 @@ export interface DeleteConfigJson {
|
||||||
*/
|
*/
|
||||||
extraDeleteReasons?: {
|
extraDeleteReasons?: {
|
||||||
/**
|
/**
|
||||||
* The text that will be shown to the user - translatable
|
* The text that will be shown to the user as option for why this point does not exist anymore.
|
||||||
|
* Note that the most common reasons (test point, does not exist anymore, cannot be found) are already offered by default
|
||||||
|
*
|
||||||
|
* question: For what extra reason might this feature be removed in real-life?
|
||||||
*/
|
*/
|
||||||
explanation: string | any
|
explanation: string | any
|
||||||
/**
|
/**
|
||||||
* The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion
|
* The text that will be uploaded into the changeset or will be used in the fixme in case of a soft deletion
|
||||||
* Should be a few words, in english
|
* Should be a few words, in english
|
||||||
|
*
|
||||||
|
* question: What should be added to the changeset as delete reason?
|
||||||
*/
|
*/
|
||||||
changesetMessage: string
|
changesetMessage: string
|
||||||
}[]
|
}[]
|
||||||
|
@ -39,10 +53,14 @@ export interface DeleteConfigJson {
|
||||||
/**
|
/**
|
||||||
* The tags that will be given to the object.
|
* The tags that will be given to the object.
|
||||||
* This must remove tags so that the 'source/osmTags' won't match anymore
|
* This must remove tags so that the 'source/osmTags' won't match anymore
|
||||||
|
*
|
||||||
|
* question: What tags should be applied to the object?
|
||||||
*/
|
*/
|
||||||
if: TagConfigJson
|
if: TagConfigJson
|
||||||
/**
|
/**
|
||||||
* The human explanation for the options
|
* The human explanation for the options
|
||||||
|
*
|
||||||
|
* question: What text should be shown to the contributor for this reason?
|
||||||
*/
|
*/
|
||||||
then: string | any
|
then: string | any
|
||||||
}[]
|
}[]
|
||||||
|
@ -53,6 +71,7 @@ export interface DeleteConfigJson {
|
||||||
* It is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!
|
* It is important that the feature will be retagged in such a way that it won't be picked up by the layer anymore!
|
||||||
*
|
*
|
||||||
* Example (note that "amenity=" erases the 'amenity'-key alltogether):
|
* Example (note that "amenity=" erases the 'amenity'-key alltogether):
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* {
|
* {
|
||||||
* "and": ["disussed:amenity=public_bookcase", "amenity="]
|
* "and": ["disussed:amenity=public_bookcase", "amenity="]
|
||||||
|
@ -60,22 +79,26 @@ export interface DeleteConfigJson {
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* or (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):
|
* or (notice the use of the ':='-tag to copy the old value of 'shop=*' into 'disused:shop='):
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* {
|
* {
|
||||||
* "and": ["disused:shop:={shop}", "shop="]
|
* "and": ["disused:shop:={shop}", "shop="]
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* question: If a hard delete is not possible, what tags should be applied to mark this feature as deleted?
|
||||||
|
* type: tag
|
||||||
*/
|
*/
|
||||||
softDeletionTags?: TagConfigJson
|
softDeletionTags?: TagConfigJson
|
||||||
/***
|
|
||||||
* By default, the contributor needs 20 previous changesets to delete points edited by others.
|
|
||||||
* For some small features (e.g. bicycle racks) this is too much and this requirement can be lowered or dropped, which can be done here.
|
|
||||||
*/
|
|
||||||
neededChangesets?: number
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this flag if the default delete reasons should be omitted from the dialog.
|
* Set this flag if the default delete reasons should be omitted from the dialog.
|
||||||
* This requires at least one extraDeleteReason or nonDeleteMapping
|
* This requires at least one extraDeleteReason or nonDeleteMapping
|
||||||
|
*
|
||||||
|
* question: Should the default delete reasons be hidden?
|
||||||
|
* iftrue: Hide the default delete reasons
|
||||||
|
* iffalse: Show the default delete reasons
|
||||||
|
* ifunset: Show the default delete reasons (default behaviour)
|
||||||
*/
|
*/
|
||||||
omitDefaultDeleteReasons?: false | boolean
|
omitDefaultDeleteReasons?: false | boolean
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ export interface LayerConfigJson {
|
||||||
* The id of this layer.
|
* The id of this layer.
|
||||||
* This should be a simple, lowercase, human readable string that is used to identify the layer.
|
* This should be a simple, lowercase, human readable string that is used to identify the layer.
|
||||||
*
|
*
|
||||||
* group: basic
|
* group: Basic
|
||||||
* question: What is the identifier of this layer?
|
* question: What is the identifier of this layer?
|
||||||
*/
|
*/
|
||||||
id: string
|
id: string
|
||||||
|
@ -27,7 +27,7 @@ export interface LayerConfigJson {
|
||||||
*
|
*
|
||||||
* ifunset: This will hide the layer in the layer control, making it not filterable and not toggleable
|
* ifunset: This will hide the layer in the layer control, making it not filterable and not toggleable
|
||||||
*
|
*
|
||||||
* group: basic
|
* group: Basic
|
||||||
* question: What is the name of this layer?
|
* question: What is the name of this layer?
|
||||||
*/
|
*/
|
||||||
name?: string | Record<string, string>
|
name?: string | Record<string, string>
|
||||||
|
@ -36,7 +36,7 @@ export interface LayerConfigJson {
|
||||||
* A description for the features shown in this layer.
|
* A description for the features shown in this layer.
|
||||||
* This often resembles the introduction of the wiki.osm.org-page for this feature.
|
* This often resembles the introduction of the wiki.osm.org-page for this feature.
|
||||||
*
|
*
|
||||||
* group: basic
|
* group: Basic
|
||||||
* question: How would you describe the features that are shown on this layer?
|
* question: How would you describe the features that are shown on this layer?
|
||||||
*/
|
*/
|
||||||
description?: string | Record<string, string>
|
description?: string | Record<string, string>
|
||||||
|
@ -54,7 +54,8 @@ export interface LayerConfigJson {
|
||||||
* Note: a source must always be defined. 'special' is only allowed if this is a builtin-layer
|
* Note: a source must always be defined. 'special' is only allowed if this is a builtin-layer
|
||||||
*
|
*
|
||||||
* types: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;
|
* types: Load data with specific tags from OpenStreetMap ; Load data from an external geojson source ;
|
||||||
* group: basic
|
* typesdefault: 0
|
||||||
|
* group: Basic
|
||||||
*/
|
*/
|
||||||
source:
|
source:
|
||||||
| "special"
|
| "special"
|
||||||
|
@ -71,6 +72,7 @@ export interface LayerConfigJson {
|
||||||
* The maximum amount of seconds that a tile is allowed to linger in the cache
|
* The maximum amount of seconds that a tile is allowed to linger in the cache
|
||||||
*
|
*
|
||||||
* type: nat
|
* type: nat
|
||||||
|
* default: 30 days
|
||||||
*/
|
*/
|
||||||
maxCacheAge?: number
|
maxCacheAge?: number
|
||||||
}
|
}
|
||||||
|
@ -128,45 +130,31 @@ export interface LayerConfigJson {
|
||||||
* "_some_key:=some_javascript_expression"
|
* "_some_key:=some_javascript_expression"
|
||||||
* ]
|
* ]
|
||||||
*
|
*
|
||||||
* group: advanced
|
* See the full documentation on [https://github.com/pietervdvn/MapComplete/blob/master/Docs/CalculatedTags.md]
|
||||||
|
*
|
||||||
|
* group: expert
|
||||||
|
* question: What extra attributes should be calculated with javascript?
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
calculatedTags?: string[]
|
calculatedTags?: string[]
|
||||||
|
|
||||||
/**
|
|
||||||
* If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.
|
|
||||||
* Works well together with 'passAllFeatures', to add decoration
|
|
||||||
*
|
|
||||||
* group: advanced
|
|
||||||
*/
|
|
||||||
doNotDownload?: boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set, only features matching this extra tag will be shown.
|
* If set, only features matching this extra tag will be shown.
|
||||||
* This is useful to hide certain features from view.
|
* This is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer.
|
||||||
*
|
|
||||||
* The default value is 'yes'
|
|
||||||
*
|
*
|
||||||
|
* question: What other tags should features match for being shown?
|
||||||
* group: advanced
|
* group: advanced
|
||||||
|
* ifunset: all features which match the 'source'-specification are shown.
|
||||||
*/
|
*/
|
||||||
isShown?: TagConfigJson
|
isShown?: TagConfigJson
|
||||||
|
|
||||||
/**
|
|
||||||
* Advanced option - might be set by the theme compiler
|
|
||||||
*
|
|
||||||
* If true, this data will _always_ be loaded, even if the theme is disabled
|
|
||||||
*
|
|
||||||
* group: advanced
|
|
||||||
*/
|
|
||||||
forceLoad?: false | boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimum needed zoomlevel required to start loading and displaying the data.
|
* The minimum needed zoomlevel required to start loading and displaying the data.
|
||||||
* This can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).
|
* This can be used to only show common features (e.g. a bicycle parking) only when the map is zoomed in very much (17).
|
||||||
* This prevents cluttering the map with thousands of parkings if one is looking to an entire city.
|
* This prevents cluttering the map with thousands of parkings if one is looking to an entire city.
|
||||||
*
|
*
|
||||||
* Default: 0
|
* Default: 0
|
||||||
* group: basic
|
* group: Basic
|
||||||
* type: nat
|
* type: nat
|
||||||
* question: At what zoom level should features of the layer be shown?
|
* question: At what zoom level should features of the layer be shown?
|
||||||
* ifunset: Always load this layer, even if the entire world is in view.
|
* ifunset: Always load this layer, even if the entire world is in view.
|
||||||
|
@ -175,8 +163,12 @@ export interface LayerConfigJson {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this layer is shown by default;
|
* Indicates if this layer is shown by default;
|
||||||
* can be used to hide a layer from start, or to load the layer but only to show it where appropriate (e.g. for snapping to it)
|
* can be used to hide a layer from start, or to load the layer but only to show it when appropriate (e.g. for advanced users)
|
||||||
*
|
*
|
||||||
|
* question: Should this layer be enabled when opening the map for the first time?
|
||||||
|
* iftrue: the layer is enabled when opening the map
|
||||||
|
* iffalse: the layer is hidden until the contributor enables it. (If the filter-popup is disabled, this might never get enabled nor loaded)
|
||||||
|
* default: true
|
||||||
* group: advanced
|
* group: advanced
|
||||||
*/
|
*/
|
||||||
shownByDefault?: true | boolean
|
shownByDefault?: true | boolean
|
||||||
|
@ -185,7 +177,7 @@ export interface LayerConfigJson {
|
||||||
* The zoom level at which point the data is hidden again
|
* The zoom level at which point the data is hidden again
|
||||||
* Default: 100 (thus: always visible
|
* Default: 100 (thus: always visible
|
||||||
*
|
*
|
||||||
* group: advanced
|
* group: expert
|
||||||
*/
|
*/
|
||||||
minzoomVisible?: number
|
minzoomVisible?: number
|
||||||
|
|
||||||
|
@ -196,6 +188,19 @@ export interface LayerConfigJson {
|
||||||
*/
|
*/
|
||||||
title?: string | TagRenderingConfigJson
|
title?: string | TagRenderingConfigJson
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Question: Should the information for this layer be shown in the sidebar or in a splash screen?
|
||||||
|
*
|
||||||
|
* If set, open the selectedElementView in a floatOver instead of on the right.
|
||||||
|
*
|
||||||
|
* iftrue: show the infobox in the splashscreen floating over the entire UI
|
||||||
|
* iffalse: show the infobox in a sidebar on the right
|
||||||
|
* group: advanced
|
||||||
|
* default: sidebar
|
||||||
|
*/
|
||||||
|
popupInFloatover?: boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small icons shown next to the title.
|
* Small icons shown next to the title.
|
||||||
* If not specified, the OsmLink and wikipedia links will be used by default.
|
* If not specified, the OsmLink and wikipedia links will be used by default.
|
||||||
|
@ -228,11 +233,40 @@ export interface LayerConfigJson {
|
||||||
/**
|
/**
|
||||||
* If set, this layer will pass all the features it receives onto the next layer.
|
* If set, this layer will pass all the features it receives onto the next layer.
|
||||||
* This is ideal for decoration, e.g. directions on cameras
|
* This is ideal for decoration, e.g. directions on cameras
|
||||||
*
|
* iftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers
|
||||||
* group: advanced
|
* iffalse: normal behaviour: don't pass features allong
|
||||||
|
* question: should this layer pass features to the next layers?
|
||||||
|
* group: expert
|
||||||
*/
|
*/
|
||||||
passAllFeatures?: boolean
|
passAllFeatures?: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.
|
||||||
|
* Works well together with 'passAllFeatures', to add decoration
|
||||||
|
* The opposite of `forceLoad`
|
||||||
|
*
|
||||||
|
* iftrue: Do not attempt to query the data for this layer from overpass/the OSM API
|
||||||
|
* iffalse: download the data as usual
|
||||||
|
* group: expert
|
||||||
|
* question: Should this layer be downloaded or is the data provided by a different layer (which has 'passAllFeatures'-set)?
|
||||||
|
* default: false
|
||||||
|
*/
|
||||||
|
doNotDownload?: boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Advanced option - might be set by the theme compiler
|
||||||
|
*
|
||||||
|
* If true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.
|
||||||
|
* The opposite of `doNotDownload`
|
||||||
|
*
|
||||||
|
* question: Should this layer be forcibly loaded?
|
||||||
|
* ifftrue: always download this layer, even if it is disabled
|
||||||
|
* iffalse: only download data for this layer when needed (default)
|
||||||
|
* default: false
|
||||||
|
* group: expert
|
||||||
|
*/
|
||||||
|
forceLoad?: false | boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Presets for this layer.
|
* Presets for this layer.
|
||||||
* A preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);
|
* A preset shows up when clicking the map on a without data (or when right-clicking/long-pressing);
|
||||||
|
@ -246,7 +280,7 @@ export interface LayerConfigJson {
|
||||||
* Note: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!
|
* Note: the icon of the preset is determined automatically based on the tags and the icon above. Don't worry about that!
|
||||||
* NB: if no presets are defined, the popup to add new points doesn't show up at all
|
* NB: if no presets are defined, the popup to add new points doesn't show up at all
|
||||||
*
|
*
|
||||||
* group: basic
|
* group: presets
|
||||||
*/
|
*/
|
||||||
presets?: {
|
presets?: {
|
||||||
/**
|
/**
|
||||||
|
@ -290,9 +324,16 @@ export interface LayerConfigJson {
|
||||||
exampleImages?: string[]
|
exampleImages?: string[]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If specified, these layers will be shown to and the new point will be snapped towards it
|
* question: Should the created point be snapped to a line layer?
|
||||||
|
*
|
||||||
|
* If specified, these layers will be shown in the precise location picker and the new point will be snapped towards it.
|
||||||
|
* For example, this can be used to snap against `walls_and_buildings` (e.g. to attach a defibrillator, an entrance, an artwork, ... to the wall)
|
||||||
|
* or to snap an obstacle (such as a bollard) to the `cycleways_and_roads`.
|
||||||
|
*
|
||||||
|
* suggestions: return Array.from(layers.keys()).map(key => ({if: "value="+key, then: key+" - "+layers.get(key).description}))
|
||||||
*/
|
*/
|
||||||
snapToLayer?: string | string[]
|
snapToLayer?: string[]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If specified, a new point will only be snapped if it is within this range.
|
* If specified, a new point will only be snapped if it is within this range.
|
||||||
* Distance in meter
|
* Distance in meter
|
||||||
|
@ -362,62 +403,70 @@ export interface LayerConfigJson {
|
||||||
* - undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future
|
* - undefined: use the mapcomplete default to show deletion or not. Currently, this is the same as 'false' but this will change in the future
|
||||||
* - or: a hash with options (see below)
|
* - or: a hash with options (see below)
|
||||||
*
|
*
|
||||||
* The delete dialog
|
* ### The delete dialog
|
||||||
* =================
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
#### Hard deletion if enough experience
|
* #### Hard deletion if enough experience
|
||||||
|
|
||||||
A feature can only be deleted from OpenStreetMap by mapcomplete if:
|
* A feature can only be deleted from OpenStreetMap by mapcomplete if:
|
||||||
|
|
||||||
- It is a node
|
* - It is a node
|
||||||
- No ways or relations use the node
|
* - No ways or relations use the node
|
||||||
- The logged-in user has enough experience OR the user is the only one to have edited the point previously
|
* - The logged-in user has enough experience OR the user is the only one to have edited the point previously
|
||||||
- The logged-in user has no unread messages (or has a ton of experience)
|
* - The logged-in user has no unread messages (or has a ton of experience)
|
||||||
- The user did not select one of the 'non-delete-options' (see below)
|
* - The user did not select one of the 'non-delete-options' (see below)
|
||||||
|
*
|
||||||
In all other cases, a 'soft deletion' is used.
|
* In all other cases, a 'soft deletion' is used.
|
||||||
|
*
|
||||||
#### Soft deletion
|
* #### Soft deletion
|
||||||
|
*
|
||||||
A 'soft deletion' is when the point isn't deleted from OSM but retagged so that it'll won't how up in the mapcomplete theme anymore.
|
* A 'soft deletion' is when the point isn't deleted fromOSM but retagged so that it'll won't how up in the mapcomplete theme anymore.
|
||||||
This makes it look like it was deleted, without doing damage. A fixme will be added to the point.
|
* This makes it look like it was deleted, without doing damage. A fixme will be added to the point.
|
||||||
|
*
|
||||||
Note that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme
|
* Note that a soft deletion is _only_ possible if these tags are provided by the theme creator, as they'll be different for every theme
|
||||||
|
*
|
||||||
#### No-delete options
|
* ##### No-delete options
|
||||||
|
*
|
||||||
In some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed "because the path is on their private property").
|
* In some cases, the contributor might want to delete something for the wrong reason (e.g. someone who wants to have a path removed "because the path is on their private property").
|
||||||
However, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice "hey, there is a path missing here! Let me redraw it in OSM!)
|
* However, the path exists in reality and should thus be on OSM - otherwise the next contributor will pass by and notice "hey, there is a path missing here! Let me redraw it in OSM!)
|
||||||
|
*
|
||||||
The correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.
|
* The correct approach is to retag the feature in such a way that it is semantically correct *and* that it doesn't show up on the theme anymore.
|
||||||
A no-delete option is offered as 'reason to delete it', but secretly retags.
|
* A no-delete option is offered as 'reason to delete it', but secretly retags.
|
||||||
|
*
|
||||||
group: editing
|
* group: editing
|
||||||
|
* types: use an advanced delete configuration ; boolean
|
||||||
*/
|
* iftrue: Allow deletion
|
||||||
deletion?: boolean | DeleteConfigJson
|
* iffalse: Do not allow deletion
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
deletion?: DeleteConfigJson | boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if a point can be moved and configures the modalities.
|
* Indicates if a point can be moved and why.
|
||||||
*
|
*
|
||||||
* A feature can be moved by MapComplete if:
|
* A feature can be moved by MapComplete if:
|
||||||
*
|
*
|
||||||
* - It is a point
|
* - It is a point
|
||||||
* - The point is _not_ part of a way or a a relation.
|
* - The point is _not_ part of a way or a a relation.
|
||||||
*
|
*
|
||||||
* Off by default. Can be enabled by setting this flag or by configuring.
|
* types: use an advanced move configuration ; boolean
|
||||||
*
|
|
||||||
* group: editing
|
* group: editing
|
||||||
|
* question: Is deleting a point allowed?
|
||||||
|
* iftrue: Allow contributors to move a point (for accuracy or a relocation)
|
||||||
|
* iffalse: Don't allow contributors to move points
|
||||||
|
* ifunset: Don't allow contributors to move points (default)
|
||||||
*/
|
*/
|
||||||
allowMove?: boolean | MoveConfigJson
|
allowMove?: MoveConfigJson | boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.
|
* If set, a 'split this way' button is shown on objects rendered as LineStrings, e.g. highways.
|
||||||
*
|
*
|
||||||
* If the way is part of a relation, MapComplete will attempt to update this relation as well
|
* If the way is part of a relation, MapComplete will attempt to update this relation as well
|
||||||
*
|
* question: Should the contributor be able to split ways using this layer?
|
||||||
|
* iftrue: enable the 'split-roads'-component
|
||||||
|
* iffalse: don't enable the split-roads componenet
|
||||||
|
* ifunset: don't enable the split-roads component
|
||||||
* group: editing
|
* group: editing
|
||||||
*/
|
*/
|
||||||
allowSplit?: boolean
|
allowSplit?: boolean
|
||||||
|
@ -432,12 +481,9 @@ export interface LayerConfigJson {
|
||||||
/**
|
/**
|
||||||
* If set, synchronizes whether or not this layer is enabled.
|
* If set, synchronizes whether or not this layer is enabled.
|
||||||
*
|
*
|
||||||
* no: Do not sync at all, always revert to default
|
|
||||||
* local: keep selection on local storage
|
|
||||||
* theme-only: sync via OSM, but this layer will only be toggled in this theme
|
|
||||||
* global: all layers with this ID will be synced accross all themes
|
|
||||||
*
|
|
||||||
* group: advanced
|
* group: advanced
|
||||||
|
* question: Should enabling/disabling the layer be saved (locally or in the cloud)?
|
||||||
|
* suggestions: return [{if: "value=no", then: "Don't save, always revert to the default"}, {if: "value=local", then: "Save selection in local storage"}, {if: "value=theme-only", then: "Save the state in the OSM-usersettings, but apply on this theme only (default)"}, {if: "value=global", then: "Save in OSM-usersettings and toggle on _all_ themes using this layer"}]
|
||||||
*/
|
*/
|
||||||
syncSelection?: "no" | "local" | "theme-only" | "global"
|
syncSelection?: "no" | "local" | "theme-only" | "global"
|
||||||
|
|
||||||
|
@ -446,17 +492,10 @@ export interface LayerConfigJson {
|
||||||
*
|
*
|
||||||
* no-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering
|
* no-question-hint-check: disables a check in MiscTagRenderingChecks which complains about 'div', 'span' or 'class=subtle'-HTML elements in the tagRendering
|
||||||
*
|
*
|
||||||
* group: special
|
* group: hidden
|
||||||
*/
|
*/
|
||||||
"#"?: string | "no-question-hint-check"
|
"#"?: string | "no-question-hint-check"
|
||||||
|
|
||||||
/**
|
|
||||||
* If set, open the selectedElementView in a floatOver instead of on the right
|
|
||||||
*
|
|
||||||
* group: advanced
|
|
||||||
*/
|
|
||||||
popupInFloatover?: boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _Set automatically by MapComplete, please ignore_
|
* _Set automatically by MapComplete, please ignore_
|
||||||
*
|
*
|
||||||
|
|
|
@ -109,7 +109,7 @@ export interface MappingConfigJson {
|
||||||
* {
|
* {
|
||||||
* "if": "crossing:marking=rainbow",
|
* "if": "crossing:marking=rainbow",
|
||||||
* "then": "This is a rainbow crossing",
|
* "then": "This is a rainbow crossing",
|
||||||
* "addExtraTags": "not:crossing:marking="
|
* "addExtraTags": ["not:crossing:marking="]
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
|
|
@ -238,13 +238,7 @@ export default class LayerConfig extends WithContextLoader {
|
||||||
throw "Layer " + this.id + " still uses the old 'preciseInput'-field"
|
throw "Layer " + this.id + " still uses the old 'preciseInput'-field"
|
||||||
}
|
}
|
||||||
if (pr.snapToLayer !== undefined) {
|
if (pr.snapToLayer !== undefined) {
|
||||||
let snapToLayers: string[]
|
let snapToLayers = pr.snapToLayer
|
||||||
if (typeof pr.snapToLayer === "string") {
|
|
||||||
snapToLayers = [pr.snapToLayer]
|
|
||||||
} else {
|
|
||||||
snapToLayers = pr.snapToLayer
|
|
||||||
}
|
|
||||||
|
|
||||||
preciseInput = {
|
preciseInput = {
|
||||||
snapToLayers,
|
snapToLayers,
|
||||||
maxSnapDistance: pr.maxSnapDistance ?? 10,
|
maxSnapDistance: pr.maxSnapDistance ?? 10,
|
||||||
|
|
10
UI/InputElement/Helpers/ImageHelper.svelte
Normal file
10
UI/InputElement/Helpers/ImageHelper.svelte
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import {UIEventSource} from "../../../Logic/UIEventSource";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simply shows the image
|
||||||
|
*/
|
||||||
|
export let value: UIEventSource<undefined | string>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<img src={$value}/>
|
|
@ -13,6 +13,7 @@ import { Utils } from "../../Utils"
|
||||||
import Locale from "../i18n/Locale"
|
import Locale from "../i18n/Locale"
|
||||||
import { Feature } from "geojson"
|
import { Feature } from "geojson"
|
||||||
import { GeoOperations } from "../../Logic/GeoOperations"
|
import { GeoOperations } from "../../Logic/GeoOperations"
|
||||||
|
import ImageHelper from "./Helpers/ImageHelper.svelte"
|
||||||
|
|
||||||
export interface InputHelperProperties {
|
export interface InputHelperProperties {
|
||||||
/**
|
/**
|
||||||
|
@ -55,6 +56,7 @@ export default class InputHelpers {
|
||||||
color: (value) => new SvelteUIElement(ColorInput, { value }),
|
color: (value) => new SvelteUIElement(ColorInput, { value }),
|
||||||
opening_hours: (value) => new OpeningHoursInput(value),
|
opening_hours: (value) => new OpeningHoursInput(value),
|
||||||
wikidata: InputHelpers.constructWikidataHelper,
|
wikidata: InputHelpers.constructWikidataHelper,
|
||||||
|
image: (value) => new SvelteUIElement(ImageHelper, { value }),
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,6 +89,7 @@ export default class InputHelpers {
|
||||||
}
|
}
|
||||||
return mapProperties
|
return mapProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
private static constructWikidataHelper(
|
private static constructWikidataHelper(
|
||||||
value: UIEventSource<string>,
|
value: UIEventSource<string>,
|
||||||
props: InputHelperProperties
|
props: InputHelperProperties
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Combine from "../Base/Combine"
|
||||||
import Title from "../Base/Title"
|
import Title from "../Base/Title"
|
||||||
import SimpleTagValidator from "./Validators/SimpleTagValidator"
|
import SimpleTagValidator from "./Validators/SimpleTagValidator"
|
||||||
import ImageUrlValidator from "./Validators/ImageUrlValidator"
|
import ImageUrlValidator from "./Validators/ImageUrlValidator"
|
||||||
import TagKeyValidator from "./Validators/TagKeyValidator";
|
import TagKeyValidator from "./Validators/TagKeyValidator"
|
||||||
|
|
||||||
export type ValidatorType = (typeof Validators.availableTypes)[number]
|
export type ValidatorType = (typeof Validators.availableTypes)[number]
|
||||||
|
|
||||||
|
@ -42,6 +42,9 @@ export default class Validators {
|
||||||
"phone",
|
"phone",
|
||||||
"opening_hours",
|
"opening_hours",
|
||||||
"color",
|
"color",
|
||||||
|
"image",
|
||||||
|
"simple_tag",
|
||||||
|
"key",
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
public static readonly AllValidators: ReadonlyArray<Validator> = [
|
public static readonly AllValidators: ReadonlyArray<Validator> = [
|
||||||
|
@ -63,7 +66,7 @@ export default class Validators {
|
||||||
new ColorValidator(),
|
new ColorValidator(),
|
||||||
new ImageUrlValidator(),
|
new ImageUrlValidator(),
|
||||||
new SimpleTagValidator(),
|
new SimpleTagValidator(),
|
||||||
new TagKeyValidator()
|
new TagKeyValidator(),
|
||||||
]
|
]
|
||||||
|
|
||||||
private static _byType = Validators._byTypeConstructor()
|
private static _byType = Validators._byTypeConstructor()
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
export let config: TagRenderingConfig
|
export let config: TagRenderingConfig
|
||||||
export let tags: UIEventSource<Record<string, string>>
|
export let tags: UIEventSource<Record<string, string>>
|
||||||
export let selectedElement: Feature
|
export let selectedElement: Feature | undefined
|
||||||
export let state: SpecialVisualizationState
|
export let state: SpecialVisualizationState
|
||||||
export let layer: LayerConfig
|
export let layer: LayerConfig
|
||||||
|
|
||||||
|
|
|
@ -8,33 +8,50 @@
|
||||||
import type {ConfigMeta} from "./configMeta";
|
import type {ConfigMeta} from "./configMeta";
|
||||||
import {Utils} from "../../Utils";
|
import {Utils} from "../../Utils";
|
||||||
|
|
||||||
|
import drinking_water from "../../assets/layers/drinking_water/drinking_water.json"
|
||||||
|
|
||||||
const layerSchema: ConfigMeta[] = layerSchemaRaw
|
const layerSchema: ConfigMeta[] = layerSchemaRaw
|
||||||
let state = new EditLayerState(layerSchema)
|
let state = new EditLayerState(layerSchema)
|
||||||
const regions = Utils.Dedup(layerSchema.map(meta => meta.hints.group))
|
state.configuration.setData(drinking_water)
|
||||||
.filter(region => region === "basic")
|
/**
|
||||||
|
* Blacklist for the general area tab
|
||||||
|
*/
|
||||||
|
const regionBlacklist = ["hidden",undefined,"infobox", "tagrenderings","maprendering"]
|
||||||
|
const allNames = Utils.Dedup(layerSchema.map(meta => meta.hints.group))
|
||||||
|
|
||||||
const perRegion: Record<string, ConfigMeta[]> = {}
|
const perRegion: Record<string, ConfigMeta[]> = {}
|
||||||
for (const region of regions) {
|
for (const region of allNames) {
|
||||||
perRegion[region] = layerSchema.filter(meta => meta.hints.group === region)
|
perRegion[region] = layerSchema.filter(meta => meta.hints.group === region)
|
||||||
}
|
}
|
||||||
console.log({perRegion})
|
|
||||||
|
const baselayerRegions: string[] = ["Basic", "presets", "editing","filters","advanced","expert"]
|
||||||
|
for (const baselayerRegion of baselayerRegions) {
|
||||||
|
if(perRegion[baselayerRegion] === undefined){
|
||||||
|
console.error("BaseLayerRegions in editLayer: no items have group '"+baselayerRegion+'"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const generalTabRegions : string[] = allNames.filter(r => regionBlacklist.indexOf(r) <0)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h3>Edit layer</h3>
|
<h3>Edit layer</h3>
|
||||||
|
|
||||||
|
<div class="m4">
|
||||||
|
{allNames}
|
||||||
<TabbedGroup tab={new UIEventSource(0)}>
|
<TabbedGroup tab={new UIEventSource(0)}>
|
||||||
<div slot="title0">General properties</div>
|
<div slot="title0">General properties</div>
|
||||||
<div class="flex flex-col" slot="content0">
|
<div class="flex flex-col" slot="content0">
|
||||||
{#each regions as region}
|
{#each baselayerRegions as region}
|
||||||
|
<Region {state} configs={perRegion[region]} title={region}/>
|
||||||
|
{/each}
|
||||||
|
{#each generalTabRegions as region}
|
||||||
<Region {state} configs={perRegion[region]} title={region}/>
|
<Region {state} configs={perRegion[region]} title={region}/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="title1">Information panel (questions and answers)</div>
|
<div slot="title1">Information panel (questions and answers)</div>
|
||||||
<div slot="content1">
|
<div slot="content1">
|
||||||
Information panel (todo)
|
<Region {state} configs={perRegion["infobox"]} title="Infobox"/>
|
||||||
|
<Region {state} configs={perRegion["tagrenderings"]} title="Infobox"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="title2">Rendering on the map</div>
|
<div slot="title2">Rendering on the map</div>
|
||||||
|
@ -42,3 +59,5 @@
|
||||||
TODO: rendering on the map
|
TODO: rendering on the map
|
||||||
</div>
|
</div>
|
||||||
</TabbedGroup>
|
</TabbedGroup>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
|
@ -2,6 +2,8 @@ import { OsmConnection } from "../../Logic/Osm/OsmConnection"
|
||||||
import { ConfigMeta } from "./configMeta"
|
import { ConfigMeta } from "./configMeta"
|
||||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||||
import { LayerConfigJson } from "../../Models/ThemeConfig/Json/LayerConfigJson"
|
import { LayerConfigJson } from "../../Models/ThemeConfig/Json/LayerConfigJson"
|
||||||
|
import { DeleteConfigJson } from "../../Models/ThemeConfig/Json/DeleteConfigJson"
|
||||||
|
import { Utils } from "../../Utils"
|
||||||
|
|
||||||
export default class EditLayerState {
|
export default class EditLayerState {
|
||||||
public readonly osmConnection: OsmConnection
|
public readonly osmConnection: OsmConnection
|
||||||
|
@ -19,11 +21,60 @@ export default class EditLayerState {
|
||||||
this.featureSwitches = {
|
this.featureSwitches = {
|
||||||
featureSwitchIsDebugging: new UIEventSource<boolean>(true),
|
featureSwitchIsDebugging: new UIEventSource<boolean>(true),
|
||||||
}
|
}
|
||||||
this.configuration.addCallback((config) => console.log("Current config is", config))
|
this.configuration.addCallback((config) => {
|
||||||
|
if (
|
||||||
|
config?.deletion !== undefined &&
|
||||||
|
(<DeleteConfigJson>config?.deletion)?.neededChangesets === undefined
|
||||||
|
) {
|
||||||
|
console.trace("Needed changesets is undefined")
|
||||||
|
}
|
||||||
|
console.log("Current config is", Utils.Clone(config))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public register(path: ReadonlyArray<string | number>, value: Store<any>) {
|
public getCurrentValueFor(path: ReadonlyArray<string | number>): any | undefined {
|
||||||
value.addCallbackAndRun((v) => {
|
// Walk the path down to see if we find something
|
||||||
|
let entry = this.configuration.data
|
||||||
|
for (let i = 0; i < path.length; i++) {
|
||||||
|
if (entry === undefined) {
|
||||||
|
// We reached a dead end - no old vlaue
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
const breadcrumb = path[i]
|
||||||
|
entry = entry[breadcrumb]
|
||||||
|
}
|
||||||
|
return entry
|
||||||
|
}
|
||||||
|
|
||||||
|
public register(
|
||||||
|
path: ReadonlyArray<string | number>,
|
||||||
|
value: Store<any>,
|
||||||
|
noInitialSync: boolean = false
|
||||||
|
): () => void {
|
||||||
|
const unsync = value.addCallback((v) => this.update(path, v))
|
||||||
|
if (!noInitialSync) {
|
||||||
|
this.update(path, value.data)
|
||||||
|
}
|
||||||
|
return unsync
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSchemaStartingWith(path: string[]) {
|
||||||
|
return this.schema.filter(
|
||||||
|
(sch) =>
|
||||||
|
!path.some((part, i) => !(sch.path.length > path.length && sch.path[i] === part))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSchema(path: string[]) {
|
||||||
|
return this.schema.filter(
|
||||||
|
(sch) =>
|
||||||
|
sch !== undefined &&
|
||||||
|
!path.some((part, i) => !(sch.path.length == path.length && sch.path[i] === part))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private update(path: ReadonlyArray<string | number>, v: any) {
|
||||||
|
{
|
||||||
let entry = this.configuration.data
|
let entry = this.configuration.data
|
||||||
for (let i = 0; i < path.length - 1; i++) {
|
for (let i = 0; i < path.length - 1; i++) {
|
||||||
const breadcrumb = path[i]
|
const breadcrumb = path[i]
|
||||||
|
@ -38,20 +89,6 @@ export default class EditLayerState {
|
||||||
delete entry[path.at(-1)]
|
delete entry[path.at(-1)]
|
||||||
}
|
}
|
||||||
this.configuration.ping()
|
this.configuration.ping()
|
||||||
})
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public getSchemaStartingWith(path: string[]) {
|
|
||||||
return this.schema.filter(
|
|
||||||
(sch) =>
|
|
||||||
!path.some((part, i) => !(sch.path.length > path.length && sch.path[i] === part))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
public getSchema(path: string[]) {
|
|
||||||
return this.schema.filter(
|
|
||||||
(sch) =>
|
|
||||||
!path.some((part, i) => !(sch.path.length == path.length && sch.path[i] === part))
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,19 @@ export let configs: ConfigMeta[]
|
||||||
export let title: string
|
export let title: string
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
{#if title}
|
||||||
|
<h3>{title}</h3>
|
||||||
|
<div class="pl-2 border border-black flex flex-col gap-y-1">
|
||||||
|
|
||||||
<h3>{title}</h3>
|
{#each configs as config}
|
||||||
<div class="pl-2 border border-black flex flex-col gap-y-1">
|
<SchemaBasedInput {state} path={config.path} schema={config}/>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="pl-2 flex flex-col gap-y-1">
|
||||||
|
{#each configs as config}
|
||||||
|
<SchemaBasedInput {state} path={config.path} schema={config}/>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#each configs as config}
|
|
||||||
<SchemaBasedInput {state} path={config.path} schema={config}/>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -3,16 +3,63 @@
|
||||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||||
import type {TagConfigJson} from "../../Models/ThemeConfig/Json/TagConfigJson";
|
import type {TagConfigJson} from "../../Models/ThemeConfig/Json/TagConfigJson";
|
||||||
import TagInput from "./TagInput/TagInput.svelte";
|
import TagInput from "./TagInput/TagInput.svelte";
|
||||||
|
import type {ConfigMeta} from "./configMeta";
|
||||||
|
import {PencilAltIcon} from "@rgossiaux/svelte-heroicons/solid";
|
||||||
|
import { onDestroy } from "svelte";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thin wrapper around 'TagInput' which registers the output with the state
|
* Thin wrapper around 'TagInput' which registers the output with the state
|
||||||
*/
|
*/
|
||||||
export let path : (string | number)[]
|
export let path: (string | number)[]
|
||||||
export let state : EditLayerState
|
export let state: EditLayerState
|
||||||
|
|
||||||
let tag: UIEventSource<TagConfigJson> = new UIEventSource<TagConfigJson>(undefined)
|
export let schema: ConfigMeta
|
||||||
|
|
||||||
state.register(path, tag)
|
const initialValue = state.getCurrentValueFor(path)
|
||||||
|
let tag: UIEventSource<TagConfigJson> = new UIEventSource<TagConfigJson>(initialValue)
|
||||||
|
|
||||||
|
onDestroy(state.register(path, tag))
|
||||||
|
|
||||||
|
let mode: "editing" | "set" = tag.data === undefined ? "editing" : "set"
|
||||||
|
|
||||||
|
function simplify(tag: TagConfigJson): string {
|
||||||
|
if (typeof tag === "string") {
|
||||||
|
return tag
|
||||||
|
}
|
||||||
|
if (tag["and"]) {
|
||||||
|
return "{ and: " + simplify(tag["and"].map(simplify).join(" ; ") + " }")
|
||||||
|
}
|
||||||
|
if (tag["or"]) {
|
||||||
|
return "{ or: " + simplify(tag["or"].map(simplify).join(" ; ") + " }")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<TagInput {tag} />
|
{#if mode === "editing"}
|
||||||
|
<div class="interactive border-interactive">
|
||||||
|
<h3>{schema.hints.question ?? "What tags should be applied?"}</h3>
|
||||||
|
{schema.description}
|
||||||
|
<TagInput {tag}/>
|
||||||
|
<div class="flex justify-end">
|
||||||
|
|
||||||
|
<button class="primary w-fit" on:click={() => {mode = "set"}}>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="low-interaction flex justify-between">
|
||||||
|
<div>
|
||||||
|
|
||||||
|
{schema.path.at(-1)}
|
||||||
|
{simplify($tag)}
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
on:click={() => {mode = "editing"}}
|
||||||
|
class="secondary h-8 w-8 shrink-0 self-start rounded-full p-1"
|
||||||
|
>
|
||||||
|
<PencilAltIcon/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig";
|
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig";
|
||||||
import {onDestroy} from "svelte";
|
import {onDestroy} from "svelte";
|
||||||
import SchemaBasedInput from "./SchemaBasedInput.svelte";
|
import SchemaBasedInput from "./SchemaBasedInput.svelte";
|
||||||
|
import type {JsonSchemaType} from "./jsonSchema";
|
||||||
|
import nmd from "nano-markdown"
|
||||||
/**
|
/**
|
||||||
* If 'types' is defined: allow the user to pick one of the types to input.
|
* If 'types' is defined: allow the user to pick one of the types to input.
|
||||||
*/
|
*/
|
||||||
|
@ -18,45 +19,116 @@
|
||||||
export let state: EditLayerState
|
export let state: EditLayerState
|
||||||
export let path: (string | number)[] = []
|
export let path: (string | number)[] = []
|
||||||
export let schema: ConfigMeta
|
export let schema: ConfigMeta
|
||||||
let value = new UIEventSource<string>(undefined)
|
const defaultOption = schema.hints.typesdefault ? Number(schema.hints.typesdefault) : undefined
|
||||||
|
|
||||||
|
const hasBooleanOption = (<JsonSchemaType[]>schema.type)?.findIndex(t => t["type"] === "boolean")
|
||||||
|
const types = schema.hints.types.split(";")
|
||||||
|
if (hasBooleanOption >= 0) {
|
||||||
|
console.log(path.join("."), ": types are", types, ", boolean index is", hasBooleanOption)
|
||||||
|
types.splice(hasBooleanOption)
|
||||||
|
}
|
||||||
|
|
||||||
const configJson: QuestionableTagRenderingConfigJson = {
|
const configJson: QuestionableTagRenderingConfigJson = {
|
||||||
id: "TYPE_OF:" + path.join("_"),
|
id: "TYPE_OF:" + path.join("_"),
|
||||||
question: "Which subcategory is needed?",
|
question: "Which subcategory is needed?",
|
||||||
questionHint: schema.description,
|
questionHint: nmd(schema.description),
|
||||||
mappings: schema.hints.types.split(";").map(opt => opt.trim()).filter(opt => opt.length > 0).map((opt, i) => ({
|
mappings: types.map(opt => opt.trim()).filter(opt => opt.length > 0).map((opt, i) => ({
|
||||||
if: "value=" + i,
|
if: "value=" + i,
|
||||||
then: opt
|
addExtraTags: ["direct="],
|
||||||
|
then: opt + (i === defaultOption ? " (Default)" : "")
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
const config = new TagRenderingConfig(configJson, "config based on " + schema.path.join("."))
|
|
||||||
let tags = new UIEventSource<Record<string, string>>({})
|
let tags = new UIEventSource<Record<string, string>>({})
|
||||||
|
|
||||||
let chosenOption: number = undefined
|
if (hasBooleanOption >= 0) {
|
||||||
|
configJson.mappings.unshift(
|
||||||
|
{
|
||||||
|
if: "direct=true",
|
||||||
|
then: "Yes " + (schema.hints.iftrue ?? ""),
|
||||||
|
addExtraTags: ["value="]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
if: "direct=false",
|
||||||
|
then: "No " + (schema.hints.iffalse ?? ""),
|
||||||
|
addExtraTags: ["value="]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const config = new TagRenderingConfig(configJson, "config based on " + schema.path.join("."))
|
||||||
|
|
||||||
|
|
||||||
|
const existingValue = state.getCurrentValueFor(path)
|
||||||
|
console.log("Setting direct: ", hasBooleanOption, path.join("."), existingValue)
|
||||||
|
if (hasBooleanOption >= 0 && (existingValue === true || existingValue === false)) {
|
||||||
|
tags.setData({direct: "" + existingValue})
|
||||||
|
} else if (existingValue) {
|
||||||
|
// We found an existing value. Let's figure out what type it matches and select that one
|
||||||
|
// We run over all possibilities and check what is required
|
||||||
|
const possibleTypes = []
|
||||||
|
outer: for (let i = 0; i < (<[]>schema.type).length; i++) {
|
||||||
|
const type = schema.type[i];
|
||||||
|
if (type.required) {
|
||||||
|
for (const requiredAttribute of type.required) {
|
||||||
|
if (existingValue[requiredAttribute] === undefined) {
|
||||||
|
console.log(path.join("."), " does not have required field", requiredAttribute, " so it cannot be type ", type)
|
||||||
|
// The 'existingValue' does _not_ have this required attribute, so it cannot be of this type
|
||||||
|
continue outer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
possibleTypes.push(i)
|
||||||
|
} else {
|
||||||
|
possibleTypes.push(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (possibleTypes.length > 0) {
|
||||||
|
tags.setData({value: "" + possibleTypes[0]})
|
||||||
|
}
|
||||||
|
} else if (defaultOption !== undefined) {
|
||||||
|
tags.setData({value: "" + defaultOption})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasBooleanOption >= 0) {
|
||||||
|
|
||||||
|
const directValue = tags.mapD(tags => {
|
||||||
|
if(tags["value"]){
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
return tags["direct"] === "true";
|
||||||
|
})
|
||||||
|
onDestroy(state.register(path, directValue, true))
|
||||||
|
}
|
||||||
|
|
||||||
|
let chosenOption: number = defaultOption
|
||||||
let subSchemas: ConfigMeta[] = []
|
let subSchemas: ConfigMeta[] = []
|
||||||
onDestroy(tags.addCallback(tags => {
|
onDestroy(tags.addCallbackAndRun(tags => {
|
||||||
chosenOption = Number(tags["value"])
|
chosenOption = tags["value"] ? Number(tags["value"]) : defaultOption
|
||||||
const type = schema.type[chosenOption]
|
const type = schema.type[chosenOption]
|
||||||
const cleanPath = <string[]> path.filter(p => typeof p === "string")
|
if (!type) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!type.properties) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const cleanPath = <string[]>path.filter(p => typeof p === "string")
|
||||||
for (const crumble of Object.keys(type.properties)) {
|
for (const crumble of Object.keys(type.properties)) {
|
||||||
console.log("Searching entries for", [...cleanPath, crumble])
|
|
||||||
subSchemas.push(...(state.getSchema([...cleanPath, crumble])))
|
subSchemas.push(...(state.getSchema([...cleanPath, crumble])))
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div class="p-2 border-2 border-dashed border-gray-300 flex flex-col gap-y-2">
|
||||||
<TagRenderingEditable {config} showQuestionIfUnknown={true} {state} {tags}/>
|
<div>
|
||||||
</div>
|
<TagRenderingEditable selectedElement={undefined} {config} showQuestionIfUnknown={true} {state} {tags}/>
|
||||||
|
|
||||||
{#if chosenOption !== undefined}
|
|
||||||
<div class="pl-2 border-2 border-dashed border-gray-300 flex flex-col gap-y-2">
|
|
||||||
{#each subSchemas as subschema}
|
|
||||||
{JSON.stringify(subschema)}
|
|
||||||
<SchemaBasedInput {state} schema={subschema} path={[...path]}></SchemaBasedInput>
|
|
||||||
{/each}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
|
{#if chosenOption !== undefined}
|
||||||
|
{#each subSchemas as subschema}
|
||||||
|
<SchemaBasedInput {state} schema={subschema}
|
||||||
|
path={[...path, (subschema?.path?.at(-1) ?? "???")]}></SchemaBasedInput>
|
||||||
|
{/each}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||||
import SchemaBasedInput from "./SchemaBasedInput.svelte";
|
import SchemaBasedInput from "./SchemaBasedInput.svelte";
|
||||||
import SchemaBasedField from "./SchemaBasedField.svelte";
|
import SchemaBasedField from "./SchemaBasedField.svelte";
|
||||||
|
import {TrashIcon} from "@babeard/svelte-heroicons/mini";
|
||||||
|
|
||||||
export let state: EditLayerState
|
export let state: EditLayerState
|
||||||
export let schema: ConfigMeta
|
export let schema: ConfigMeta
|
||||||
|
@ -21,15 +22,22 @@
|
||||||
|
|
||||||
const subparts = state.getSchemaStartingWith(schema.path)
|
const subparts = state.getSchemaStartingWith(schema.path)
|
||||||
|
|
||||||
console.log("Subparts for", schema.path, " are", subparts)
|
|
||||||
|
|
||||||
let createdItems = 0
|
let createdItems = 0
|
||||||
/**
|
/**
|
||||||
* Keeps track of the items.
|
* Keeps track of the items.
|
||||||
* We keep a single string (stringified 'createdItems') to make sure the order is corrects
|
* We keep a single string (stringified 'createdItems') to make sure the order is correct
|
||||||
*/
|
*/
|
||||||
export let values: UIEventSource<number[]> = new UIEventSource<number[]>([])
|
export let values: UIEventSource<number[]> = new UIEventSource<number[]>([])
|
||||||
|
|
||||||
|
const currentValue = <[]>state.getCurrentValueFor(path)
|
||||||
|
if (currentValue) {
|
||||||
|
if (!Array.isArray(currentValue)) {
|
||||||
|
console.error("SchemaBaseArray for path", path, "expected an array as initial value, but got a", typeof currentValue, currentValue)
|
||||||
|
} else {
|
||||||
|
values.setData(currentValue.map((_, i) => i))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function createItem() {
|
function createItem() {
|
||||||
values.data.push(createdItems)
|
values.data.push(createdItems)
|
||||||
createdItems++
|
createdItems++
|
||||||
|
@ -69,7 +77,12 @@
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
{#each $values as value (value)}
|
{#each $values as value (value)}
|
||||||
<h3>{singular} {value}</h3>
|
<div class="flex justify-between items-center">
|
||||||
|
<h3 class="m-0">{singular} {value}</h3>
|
||||||
|
<button class="border-black border rounded-full p-1 w-fit h-fit" on:click={() => {values.data.splice(values.data.indexOf(value)); values.ping()}}>
|
||||||
|
<TrashIcon class="w-4 h-4"/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div class="border border-black">
|
<div class="border border-black">
|
||||||
{#each subparts as subpart}
|
{#each subparts as subpart}
|
||||||
<SchemaBasedInput {state} path={fusePath(value, subpart.path)} schema={subpart}/>
|
<SchemaBasedInput {state} path={fusePath(value, subpart.path)} schema={subpart}/>
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
import type {ConfigMeta} from "./configMeta";
|
import type {ConfigMeta} from "./configMeta";
|
||||||
import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte";
|
import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte";
|
||||||
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig";
|
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig";
|
||||||
|
import nmd from "nano-markdown"
|
||||||
import type {
|
import type {
|
||||||
QuestionableTagRenderingConfigJson
|
QuestionableTagRenderingConfigJson
|
||||||
} from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson";
|
} from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson";
|
||||||
import EditLayerState from "./EditLayerState";
|
import EditLayerState from "./EditLayerState";
|
||||||
|
import { onDestroy } from "svelte";
|
||||||
|
|
||||||
|
|
||||||
export let state: EditLayerState
|
export let state: EditLayerState
|
||||||
|
@ -15,22 +17,21 @@
|
||||||
export let schema: ConfigMeta
|
export let schema: ConfigMeta
|
||||||
let value = new UIEventSource<string>(undefined)
|
let value = new UIEventSource<string>(undefined)
|
||||||
|
|
||||||
|
|
||||||
const configJson: QuestionableTagRenderingConfigJson = {
|
const configJson: QuestionableTagRenderingConfigJson = {
|
||||||
id: path.join("_"),
|
id: path.join("_"),
|
||||||
render: schema.hints.inline ?? schema.path.at(-1) + ": <b>{value}</b>",
|
render: schema.type === "boolean" ? undefined : schema.hints.inline ?? schema.path.at(-1) + ": <b>{value}</b>",
|
||||||
question: schema.hints.question,
|
question: schema.hints.question,
|
||||||
questionHint: schema.description,
|
questionHint: nmd(schema.description),
|
||||||
freeform: {
|
freeform: schema.type === "boolean" ? undefined : {
|
||||||
key: "value",
|
key: "value",
|
||||||
type: schema.hints.typehint ?? "string",
|
type: schema.hints.typehint ?? "string",
|
||||||
inline: schema.hints.inline !== undefined
|
inline: schema.hints.inline !== undefined
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.hints.default) {
|
if (schema.hints.default) {
|
||||||
configJson.mappings = [{
|
configJson.mappings = [{
|
||||||
if: "value=", // +schema.hints.default,
|
if: "value=", // We leave this blank
|
||||||
then: schema.path.at(-1) + " is not set. The default value <b>" + schema.hints.default + "</b> will be used. " + (schema.hints.ifunset ?? ""),
|
then: schema.path.at(-1) + " is not set. The default value <b>" + schema.hints.default + "</b> will be used. " + (schema.hints.ifunset ?? ""),
|
||||||
}]
|
}]
|
||||||
} else if (!schema.required) {
|
} else if (!schema.required) {
|
||||||
|
@ -39,22 +40,58 @@
|
||||||
then: schema.path.at(-1) + " is not set. " + (schema.hints.ifunset ?? ""),
|
then: schema.path.at(-1) + " is not set. " + (schema.hints.ifunset ?? ""),
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (schema.type === "boolean" || (Array.isArray(schema.type) && schema.type.some(t => t["type"] === "boolean") >= 0)) {
|
||||||
|
configJson.mappings = configJson.mappings ?? []
|
||||||
|
configJson.mappings.push(
|
||||||
|
{
|
||||||
|
if: "value=true",
|
||||||
|
then: "Yes "+(schema.hints?.iftrue??"")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
if: "value=false",
|
||||||
|
then: "No "+(schema.hints?.iffalse??"")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (schema.hints.suggestions) {
|
||||||
|
if (!configJson.mappings) {
|
||||||
|
configJson.mappings = []
|
||||||
|
}
|
||||||
|
configJson.mappings.push(...schema.hints.suggestions)
|
||||||
|
}
|
||||||
let config: TagRenderingConfig
|
let config: TagRenderingConfig
|
||||||
let err: string = undefined
|
let err: string = undefined
|
||||||
try {
|
try {
|
||||||
config = new TagRenderingConfig(configJson, "config based on " + schema.path.join("."))
|
config = new TagRenderingConfig(configJson, "config based on " + schema.path.join("."))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e, config)
|
console.error(e, config)
|
||||||
err = e
|
err = path.join(".") + " " + e
|
||||||
}
|
}
|
||||||
let tags = new UIEventSource<Record<string, string>>({})
|
let startValue = state.getCurrentValueFor(path)
|
||||||
state.register(path, tags.map(tgs => tgs["value"]))
|
if (startValue?.["en"]) {
|
||||||
|
startValue = startValue["en"]
|
||||||
|
}
|
||||||
|
console.log("Startvalue for", path.join("."), "is", startValue)
|
||||||
|
let tags = new UIEventSource<Record<string, string>>({value: startValue ?? ""})
|
||||||
|
onDestroy(state.register(path, tags.map(tgs => {
|
||||||
|
const v = tgs["value"];
|
||||||
|
if (schema.type === "boolan") {
|
||||||
|
return v === "true" || v === "yes" || v === "1"
|
||||||
|
}
|
||||||
|
if (schema.type === "number") {
|
||||||
|
return Number(v)
|
||||||
|
}
|
||||||
|
return v
|
||||||
|
})))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if err !== undefined}
|
{#if err !== undefined}
|
||||||
<span class="alert">{err}</span>
|
<span class="alert">{err}</span>
|
||||||
|
{JSON.stringify(schema)}
|
||||||
{:else}
|
{:else}
|
||||||
<div>
|
<div>
|
||||||
<TagRenderingEditable {config} showQuestionIfUnknown={true} {state} {tags}/>
|
<TagRenderingEditable {config} selectedElement={undefined} showQuestionIfUnknown={true} {state} {tags}/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
{#if schema.type === "array"}
|
{#if schema.type === "array"}
|
||||||
<SchemaBasedArray {path} {state} {schema}/>
|
<SchemaBasedArray {path} {state} {schema}/>
|
||||||
{:else if schema.hints.typehint === "tag"}
|
{:else if schema.hints.typehint === "tag"}
|
||||||
<RegisteredTagInput {state} {path}/>
|
<RegisteredTagInput {state} {path} {schema}/>
|
||||||
{:else if schema.hints.types}
|
{:else if schema.hints.types}
|
||||||
<SchemaBaseMultiType {path} {state} {schema}/>
|
<SchemaBaseMultiType {path} {state} {schema}/>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
|
@ -5,10 +5,8 @@
|
||||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||||
import type {TagConfigJson} from "../../Models/ThemeConfig/Json/TagConfigJson";
|
import type {TagConfigJson} from "../../Models/ThemeConfig/Json/TagConfigJson";
|
||||||
import BasicTagInput from "./TagInput/BasicTagInput.svelte";
|
import BasicTagInput from "./TagInput/BasicTagInput.svelte";
|
||||||
import {onDestroy} from "svelte";
|
|
||||||
import TagInfoStats from "./TagInfoStats.svelte";
|
|
||||||
import TagInput from "./TagInput/TagInput.svelte";
|
import TagInput from "./TagInput/TagInput.svelte";
|
||||||
import exp from "constants";
|
import {TrashIcon} from "@babeard/svelte-heroicons/mini";
|
||||||
|
|
||||||
export let tag: UIEventSource<TagConfigJson>
|
export let tag: UIEventSource<TagConfigJson>
|
||||||
let mode: "and" | "or" = "and"
|
let mode: "and" | "or" = "and"
|
||||||
|
@ -39,20 +37,44 @@ function update(_) {
|
||||||
}
|
}
|
||||||
tags.push(t)
|
tags.push(t)
|
||||||
}
|
}
|
||||||
config[mode] = tags
|
if (tags.length === 1) {
|
||||||
tag.setData(config)
|
tag.setData(tags[0])
|
||||||
|
} else {
|
||||||
|
config[mode] = tags
|
||||||
|
tag.setData(config)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function addBasicTag() {
|
function addBasicTag(value?: string) {
|
||||||
const src = new UIEventSource(undefined)
|
const src = new UIEventSource(value)
|
||||||
basicTags.data.push(src);
|
basicTags.data.push(src);
|
||||||
basicTags.ping()
|
basicTags.ping()
|
||||||
src.addCallbackAndRunD(_ => update(_))
|
src.addCallbackAndRunD(_ => update(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
function addExpression() {
|
function removeTag(basicTag: UIEventSource<any>) {
|
||||||
const src = new UIEventSource(undefined)
|
const index = basicTags.data.indexOf(basicTag)
|
||||||
|
console.log("Removing", index, basicTag)
|
||||||
|
if (index >= 0) {
|
||||||
|
basicTag.setData(undefined)
|
||||||
|
basicTags.data.splice(index, 1)
|
||||||
|
basicTags.ping()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeExpression(expr: UIEventSource<any>) {
|
||||||
|
const index = expressions.data.indexOf(expr)
|
||||||
|
if (index >= 0) {
|
||||||
|
expr.setData(undefined)
|
||||||
|
expressions.data.splice(index, 1)
|
||||||
|
expressions.ping()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function addExpression(expr?: TagConfigJson) {
|
||||||
|
const src = new UIEventSource(expr)
|
||||||
expressions.data.push(src);
|
expressions.data.push(src);
|
||||||
expressions.ping()
|
expressions.ping()
|
||||||
src.addCallbackAndRunD(_ => update(_))
|
src.addCallbackAndRunD(_ => update(_))
|
||||||
|
@ -60,9 +82,40 @@ function addExpression() {
|
||||||
|
|
||||||
|
|
||||||
$: update(mode)
|
$: update(mode)
|
||||||
|
expressions.addCallback(_ => update(_))
|
||||||
|
basicTags.addCallback(_ => update(_))
|
||||||
|
|
||||||
|
let initialTag: TagConfigJson = tag.data
|
||||||
|
|
||||||
|
function initWith(initialTag: TagConfigJson) {
|
||||||
|
if (typeof initialTag === "string") {
|
||||||
|
addBasicTag(initialTag)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mode = <"or" | "and">Object.keys(initialTag)[0]
|
||||||
|
const subExprs = (<TagConfigJson[]>initialTag[mode])
|
||||||
|
if (subExprs.length == 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (subExprs.length == 1) {
|
||||||
|
initWith(subExprs[0])
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (const subExpr of subExprs) {
|
||||||
|
if (typeof subExpr === "string") {
|
||||||
|
addBasicTag(subExpr)
|
||||||
|
} else {
|
||||||
|
addExpression(subExpr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!initialTag) {
|
||||||
|
addBasicTag()
|
||||||
|
} else {
|
||||||
|
initWith(initialTag)
|
||||||
|
}
|
||||||
|
|
||||||
addBasicTag()
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -76,19 +129,30 @@ addBasicTag()
|
||||||
{/if}
|
{/if}
|
||||||
</select>
|
</select>
|
||||||
<div class="border-l-4 border-black flex flex-col ml-1 pl-1">
|
<div class="border-l-4 border-black flex flex-col ml-1 pl-1">
|
||||||
{#each $basicTags as basicTag}
|
{#each $basicTags as basicTag (basicTag)}
|
||||||
<BasicTagInput {overpassSupportNeeded} {uploadableOnly} tag={basicTag}/>
|
<div class="flex">
|
||||||
|
<BasicTagInput {overpassSupportNeeded} {uploadableOnly} tag={basicTag}/>
|
||||||
|
<button class="border border-black rounded-full w-fit h-fit p-0" on:click={() => removeTag(basicTag)}>
|
||||||
|
<TrashIcon class="w-4 h-4 p-1"/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{#each $expressions as expression}
|
{#each $expressions as expression}
|
||||||
<TagInput {overpassSupportNeeded} {uploadableOnly} tag={expression}/>
|
<TagInput {overpassSupportNeeded} {uploadableOnly} tag={expression}>
|
||||||
|
<button slot="delete" on:click={() => removeExpression(expression)}>
|
||||||
|
<TrashIcon class="w-4 h-4 p-1"/>
|
||||||
|
Delete subexpression
|
||||||
|
</button>
|
||||||
|
</TagInput>
|
||||||
{/each}
|
{/each}
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<button class="primary w-fit" on:click={addBasicTag}>
|
<button class="w-fit" on:click={() => addBasicTag()}>
|
||||||
Add a tag
|
Add a tag
|
||||||
</button>
|
</button>
|
||||||
<button class="w-fit" on:click={addExpression}>
|
<button class="w-fit" on:click={() => addExpression()}>
|
||||||
Add an expression
|
Add an expression
|
||||||
</button>
|
</button>
|
||||||
|
<slot name="delete"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,6 @@
|
||||||
export let tag: UIEventSource<string> = new UIEventSource<string>(undefined)
|
export let tag: UIEventSource<string> = new UIEventSource<string>(undefined)
|
||||||
export let uploadableOnly: boolean
|
export let uploadableOnly: boolean
|
||||||
export let overpassSupportNeeded: boolean
|
export let overpassSupportNeeded: boolean
|
||||||
tag.addCallback(tag => console.log("Current tag is", tag))
|
|
||||||
|
|
||||||
console.log({uploadableOnly, overpassSupportNeeded})
|
|
||||||
|
|
||||||
|
|
||||||
let feedbackGlobal = tag.map(tag => {
|
let feedbackGlobal = tag.map(tag => {
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
|
@ -56,6 +52,24 @@
|
||||||
modes.push(...TagUtils.comparators.map(c => c[0]))
|
modes.push(...TagUtils.comparators.map(c => c[0]))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (tag.data) {
|
||||||
|
const sortedModes = [...modes]
|
||||||
|
sortedModes.sort((a, b) => b.length - a.length)
|
||||||
|
const t = tag.data
|
||||||
|
console.log(t)
|
||||||
|
for (const m of sortedModes) {
|
||||||
|
if (t.indexOf(m) >= 0) {
|
||||||
|
const [k, v] = t.split(m)
|
||||||
|
keyValue.setData(k)
|
||||||
|
valueValue.setData(v)
|
||||||
|
mode = m
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onDestroy(valueValue.addCallbackAndRun(setTag))
|
onDestroy(valueValue.addCallbackAndRun(setTag))
|
||||||
onDestroy(keyValue.addCallbackAndRun(setTag))
|
onDestroy(keyValue.addCallbackAndRun(setTag))
|
||||||
|
|
||||||
|
@ -66,25 +80,34 @@
|
||||||
function setTag(_) {
|
function setTag(_) {
|
||||||
const k = keyValue.data
|
const k = keyValue.data
|
||||||
const v = valueValue.data
|
const v = valueValue.data
|
||||||
tag.setData(k + mode + v)
|
const t = k + mode + v
|
||||||
|
try {
|
||||||
|
TagUtils.Tag(t)
|
||||||
|
tag.setData(t)
|
||||||
|
} catch (e) {
|
||||||
|
tag.setData(undefined)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div class="flex items-center">
|
||||||
|
|
||||||
<ValidatedInput feedback={feedbackKey} placeholder="The key of the tag" type="key"
|
<div class="flex h-fit ">
|
||||||
value={keyValue}></ValidatedInput>
|
|
||||||
<select bind:value={mode}>
|
<ValidatedInput feedback={feedbackKey} placeholder="The key of the tag" type="key"
|
||||||
{#each modes as option}
|
value={keyValue}></ValidatedInput>
|
||||||
<option value={option}>
|
<select bind:value={mode}>
|
||||||
{option}
|
{#each modes as option}
|
||||||
</option>
|
<option value={option}>
|
||||||
{/each}
|
{option}
|
||||||
</select>
|
</option>
|
||||||
<ValidatedInput feedback={feedbackValue} placeholder="The value of the tag" type="string"
|
{/each}
|
||||||
value={valueValue}></ValidatedInput>
|
</select>
|
||||||
|
<ValidatedInput feedback={feedbackValue} placeholder="The value of the tag" type="string"
|
||||||
|
value={valueValue}></ValidatedInput>
|
||||||
|
</div>
|
||||||
|
|
||||||
{#if $feedbackKey}
|
{#if $feedbackKey}
|
||||||
<Tr cls="alert" t={$feedbackKey}/>
|
<Tr cls="alert" t={$feedbackKey}/>
|
||||||
|
@ -93,6 +116,5 @@
|
||||||
{:else if $feedbackGlobal}
|
{:else if $feedbackGlobal}
|
||||||
<Tr cls="alert" t={$feedbackGlobal}/>
|
<Tr cls="alert" t={$feedbackGlobal}/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<TagInfoStats {tag}/>
|
<TagInfoStats {tag}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,5 +12,7 @@ export let overpassSupportNeeded: boolean
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-4">
|
<div class="m-4">
|
||||||
<TagExpression {overpassSupportNeeded} {tag} {uploadableOnly}/>
|
<TagExpression {overpassSupportNeeded} {tag} {uploadableOnly}>
|
||||||
|
<slot name="delete" slot="delete"/>
|
||||||
|
</TagExpression>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,9 +11,13 @@ export interface ConfigMeta {
|
||||||
*/
|
*/
|
||||||
types?: string
|
types?: string
|
||||||
question?: string
|
question?: string
|
||||||
|
iftrue?: string
|
||||||
|
iffalse?: string
|
||||||
ifunset?: string
|
ifunset?: string
|
||||||
inline?: string
|
inline?: string
|
||||||
default?: string
|
default?: string
|
||||||
|
typesdefault?: string
|
||||||
|
suggestions?: []
|
||||||
}
|
}
|
||||||
required: boolean
|
required: boolean
|
||||||
description: string
|
description: string
|
||||||
|
|
|
@ -120,6 +120,10 @@
|
||||||
JavaScript
|
JavaScript
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="border-interactive">
|
||||||
|
Area with extreme high interactivity due to `border-interactive`
|
||||||
|
</div>
|
||||||
|
|
||||||
<select>
|
<select>
|
||||||
<option value="A">A</option>
|
<option value="A">A</option>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -419,7 +419,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {},
|
"hints": {},
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": \"not:crossing:marking=\"\n}\n```"
|
"description": "If chosen as answer, these tags will be applied as well onto the object.\nNot compatible with multiAnswer.\n\nThis can be used e.g. to erase other keys which indicate the 'not' value:\n```json\n{\n \"if\": \"crossing:marking=rainbow\",\n \"then\": \"This is a rainbow crossing\",\n \"addExtraTags\": [\"not:crossing:marking=\"]\n}\n```"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
|
|
15
package-lock.json
generated
15
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "mapcomplete",
|
"name": "mapcomplete",
|
||||||
"version": "0.30.6",
|
"version": "0.30.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mapcomplete",
|
"name": "mapcomplete",
|
||||||
"version": "0.30.6",
|
"version": "0.30.7",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@onsvisual/svelte-maps": "^1.1.6",
|
"@onsvisual/svelte-maps": "^1.1.6",
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
"lz-string": "^1.4.4",
|
"lz-string": "^1.4.4",
|
||||||
"mangrove-reviews-typescript": "^1.1.0",
|
"mangrove-reviews-typescript": "^1.1.0",
|
||||||
"maplibre-gl": "^2.4.0",
|
"maplibre-gl": "^2.4.0",
|
||||||
|
"nano-markdown": "^1.2.2",
|
||||||
"opening_hours": "^3.6.0",
|
"opening_hours": "^3.6.0",
|
||||||
"osm-auth": "^1.0.2",
|
"osm-auth": "^1.0.2",
|
||||||
"osmtogeojson": "^3.0.0-beta.5",
|
"osmtogeojson": "^3.0.0-beta.5",
|
||||||
|
@ -7928,6 +7929,11 @@
|
||||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/nano-markdown": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/nano-markdown/-/nano-markdown-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-xp0zc42GsE0JVpcTxICpANgNbVfyhk2pUdRV3cDDxzqVZeXSZgrPGruwlj+umFQxo10BKD1qmWdEdxj1x+A0QQ=="
|
||||||
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz",
|
||||||
|
@ -18125,6 +18131,11 @@
|
||||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"nano-markdown": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/nano-markdown/-/nano-markdown-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-xp0zc42GsE0JVpcTxICpANgNbVfyhk2pUdRV3cDDxzqVZeXSZgrPGruwlj+umFQxo10BKD1qmWdEdxj1x+A0QQ=="
|
||||||
|
},
|
||||||
"nanoid": {
|
"nanoid": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz",
|
||||||
|
|
|
@ -91,6 +91,7 @@
|
||||||
"lz-string": "^1.4.4",
|
"lz-string": "^1.4.4",
|
||||||
"mangrove-reviews-typescript": "^1.1.0",
|
"mangrove-reviews-typescript": "^1.1.0",
|
||||||
"maplibre-gl": "^2.4.0",
|
"maplibre-gl": "^2.4.0",
|
||||||
|
"nano-markdown": "^1.2.2",
|
||||||
"opening_hours": "^3.6.0",
|
"opening_hours": "^3.6.0",
|
||||||
"osm-auth": "^1.0.2",
|
"osm-auth": "^1.0.2",
|
||||||
"osmtogeojson": "^3.0.0-beta.5",
|
"osmtogeojson": "^3.0.0-beta.5",
|
||||||
|
|
|
@ -1,7 +1,25 @@
|
||||||
import ScriptUtils from "./ScriptUtils"
|
import ScriptUtils from "./ScriptUtils"
|
||||||
import { readFileSync, writeFileSync } from "fs"
|
import { readFileSync, writeFileSync } from "fs"
|
||||||
import { JsonSchema } from "../UI/Studio/jsonSchema"
|
import { JsonSchema } from "../UI/Studio/jsonSchema"
|
||||||
|
import { AllSharedLayers } from "../Customizations/AllSharedLayers"
|
||||||
|
import { AllKnownLayouts } from "../Customizations/AllKnownLayouts"
|
||||||
|
import { ConfigMeta } from "../UI/Studio/configMeta"
|
||||||
|
import { Or } from "../Logic/Tags/Or"
|
||||||
|
|
||||||
|
const metainfo = {
|
||||||
|
type: "One of the inputValidator types",
|
||||||
|
types: "Is multiple types are allowed for this field, then first show a mapping to pick the appropriate subtype. `Types` should be `;`-separated and contain precisely the same amount of subtypes",
|
||||||
|
typesdefault: "Works in conjuction with `types`: this type will be selected by default",
|
||||||
|
group: "A kind of label. Items with the same group name will be placed in the same region",
|
||||||
|
default: "The default value which is used if no value is specified",
|
||||||
|
question: "The question to ask in the tagRenderingConfig",
|
||||||
|
iftrue: "For booleans only - text to show with 'yes'",
|
||||||
|
iffalse: "For booleans only - text to show with 'no'",
|
||||||
|
ifunset:
|
||||||
|
"Only applicable if _not_ a required item. This will appear in the 'not set'-option as extra description",
|
||||||
|
inline: "A text, containing `{value}`. This will be used as freeform rendering and will be included into the rendering",
|
||||||
|
suggestions: "a javascript expression generating mappings",
|
||||||
|
}
|
||||||
function WalkScheme<T>(
|
function WalkScheme<T>(
|
||||||
onEach: (schemePart: JsonSchema, path: string[]) => T,
|
onEach: (schemePart: JsonSchema, path: string[]) => T,
|
||||||
scheme: JsonSchema,
|
scheme: JsonSchema,
|
||||||
|
@ -23,6 +41,7 @@ function WalkScheme<T>(
|
||||||
}
|
}
|
||||||
const definitionName = ref.substr(prefix.length)
|
const definitionName = ref.substr(prefix.length)
|
||||||
if (isHandlingReference.indexOf(definitionName) >= 0) {
|
if (isHandlingReference.indexOf(definitionName) >= 0) {
|
||||||
|
// We abort here to avoid infinite recursion
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
const loadedScheme = fullScheme.definitions[definitionName]
|
const loadedScheme = fullScheme.definitions[definitionName]
|
||||||
|
@ -91,7 +110,7 @@ function WalkScheme<T>(
|
||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMetafields(fieldnames: string[], fullSchema: JsonSchema) {
|
function addMetafields(fieldnames: string[], fullSchema: JsonSchema): ConfigMeta[] {
|
||||||
const onEach = (schemePart, path) => {
|
const onEach = (schemePart, path) => {
|
||||||
if (schemePart.description === undefined) {
|
if (schemePart.description === undefined) {
|
||||||
return
|
return
|
||||||
|
@ -139,31 +158,75 @@ function addMetafields(fieldnames: string[], fullSchema: JsonSchema) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hints["suggestions"]) {
|
||||||
|
const suggestions = hints["suggestions"]
|
||||||
|
console.log("Creating suggestions for expression", suggestions)
|
||||||
|
const f = new Function("{ layers, themes }", suggestions)
|
||||||
|
hints["suggestions"] = f({
|
||||||
|
layers: AllSharedLayers.sharedLayers,
|
||||||
|
themes: AllKnownLayouts.allKnownLayouts,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return { hints, type, description: description.join("\n") }
|
return { hints, type, description: description.join("\n") }
|
||||||
}
|
}
|
||||||
|
|
||||||
return WalkScheme(onEach, fullSchema, fullSchema, [], [], fullSchema.required)
|
return WalkScheme(onEach, fullSchema, fullSchema, [], [], fullSchema.required).map(
|
||||||
|
({ path, required, t }) => ({ path, required, ...t })
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractMeta(typename: string, path: string) {
|
function substituteReferences(
|
||||||
|
paths: ConfigMeta[],
|
||||||
|
origSchema: JsonSchema,
|
||||||
|
allDefinitions: Record<string, JsonSchema>
|
||||||
|
) {
|
||||||
|
for (const path of paths) {
|
||||||
|
if (!Array.isArray(path.type)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for (let i = 0; i < path.type.length; i++) {
|
||||||
|
const typeElement = path.type[i]
|
||||||
|
const ref = typeElement["$ref"]
|
||||||
|
if (!ref) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const name = ref.substring("#/definitions/".length)
|
||||||
|
if (name === "TagRenderingConfigJson") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (name.startsWith("{") || name.startsWith("Record<")) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (origSchema["definitions"]?.[name]) {
|
||||||
|
path.type[i] = origSchema["definitions"]?.[name]
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name === "DeleteConfigJson") {
|
||||||
|
const target = allDefinitions[name]
|
||||||
|
if (!target) {
|
||||||
|
throw "Cannot expand reference for type " + name + "; it does not exist "
|
||||||
|
}
|
||||||
|
path.type[i] = target
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Expanding " + name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractMeta(typename: string, path: string, allDefinitions: Record<string, JsonSchema>) {
|
||||||
let themeSchema: JsonSchema = JSON.parse(
|
let themeSchema: JsonSchema = JSON.parse(
|
||||||
readFileSync("./Docs/Schemas/" + typename + ".schema.json", { encoding: "utf8" })
|
readFileSync("./Docs/Schemas/" + typename + ".schema.json", { encoding: "utf8" })
|
||||||
)
|
)
|
||||||
|
|
||||||
const metainfo = {
|
|
||||||
type: "One of the inputValidator types",
|
|
||||||
types: "Is multiple types are allowed for this field, then first show a mapping to pick the appropriate subtype. `Types` should be `;`-separated and contain precisely the same amount of subtypes",
|
|
||||||
group: "A kind of label. Items with the same group name will be placed in the same region",
|
|
||||||
default: "The default value which is used if no value is specified",
|
|
||||||
question: "The question to ask in the tagRenderingConfig",
|
|
||||||
ifunset:
|
|
||||||
"Only applicable if _not_ a required item. This will appear in the 'not set'-option as extra description",
|
|
||||||
inline: "A text, containing `{value}`. This will be used as freeform rendering and will be included into the rendering",
|
|
||||||
}
|
|
||||||
const metakeys = Array.from(Object.keys(metainfo))
|
const metakeys = Array.from(Object.keys(metainfo))
|
||||||
|
|
||||||
const hints = addMetafields(metakeys, themeSchema)
|
const paths = addMetafields(metakeys, themeSchema)
|
||||||
const paths = hints.map(({ path, required, t }) => ({ path, required, ...t }))
|
|
||||||
|
substituteReferences(paths, themeSchema, allDefinitions)
|
||||||
|
|
||||||
writeFileSync("./assets/" + path + ".json", JSON.stringify(paths, null, " "))
|
writeFileSync("./assets/" + path + ".json", JSON.stringify(paths, null, " "))
|
||||||
console.log("Written meta to ./assets/" + path)
|
console.log("Written meta to ./assets/" + path)
|
||||||
|
@ -173,6 +236,7 @@ function main() {
|
||||||
const allSchemas = ScriptUtils.readDirRecSync("./Docs/Schemas").filter((pth) =>
|
const allSchemas = ScriptUtils.readDirRecSync("./Docs/Schemas").filter((pth) =>
|
||||||
pth.endsWith("JSC.ts")
|
pth.endsWith("JSC.ts")
|
||||||
)
|
)
|
||||||
|
const allDefinitions: Record<string, JsonSchema> = {}
|
||||||
for (const path of allSchemas) {
|
for (const path of allSchemas) {
|
||||||
const dir = path.substring(0, path.lastIndexOf("/"))
|
const dir = path.substring(0, path.lastIndexOf("/"))
|
||||||
const name = path.substring(path.lastIndexOf("/"), path.length - "JSC.ts".length)
|
const name = path.substring(path.lastIndexOf("/"), path.length - "JSC.ts".length)
|
||||||
|
@ -187,14 +251,20 @@ function main() {
|
||||||
def["additionalProperties"] = false
|
def["additionalProperties"] = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allDefinitions[name.substring(1)] = parsed
|
||||||
writeFileSync(dir + "/" + name + ".schema.json", JSON.stringify(parsed, null, " "), {
|
writeFileSync(dir + "/" + name + ".schema.json", JSON.stringify(parsed, null, " "), {
|
||||||
encoding: "utf8",
|
encoding: "utf8",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
extractMeta("LayerConfigJson", "layerconfigmeta")
|
extractMeta("LayerConfigJson", "layerconfigmeta", allDefinitions)
|
||||||
extractMeta("LayoutConfigJson", "layoutconfigmeta")
|
extractMeta("LayoutConfigJson", "layoutconfigmeta", allDefinitions)
|
||||||
extractMeta("TagRenderingConfigJson", "tagrenderingconfigmeta")
|
extractMeta("TagRenderingConfigJson", "tagrenderingconfigmeta", allDefinitions)
|
||||||
extractMeta("QuestionableTagRenderingConfigJson", "questionabletagrenderingconfigmeta")
|
extractMeta(
|
||||||
|
"QuestionableTagRenderingConfigJson",
|
||||||
|
"questionabletagrenderingconfigmeta",
|
||||||
|
allDefinitions
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue