diff --git a/Docs/Schemas/DeleteConfigJson.schema.json b/Docs/Schemas/DeleteConfigJson.schema.json index c19c64ed7..b7bbec42a 100644 --- a/Docs/Schemas/DeleteConfigJson.schema.json +++ b/Docs/Schemas/DeleteConfigJson.schema.json @@ -1,6 +1,10 @@ { "type": "object", "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": { "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", @@ -8,10 +12,10 @@ "type": "object", "properties": { "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": { - "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" } }, @@ -29,10 +33,10 @@ "properties": { "if": { "$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": { - "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": [ @@ -42,7 +46,7 @@ } }, "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": [ { "$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": { - "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" } }, diff --git a/Docs/Schemas/DeleteConfigJsonJSC.ts b/Docs/Schemas/DeleteConfigJsonJSC.ts index 5e3bb6ada..afb24d2dd 100644 --- a/Docs/Schemas/DeleteConfigJsonJSC.ts +++ b/Docs/Schemas/DeleteConfigJsonJSC.ts @@ -1,6 +1,10 @@ export default { "type": "object", "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": { "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", @@ -8,10 +12,10 @@ export default { "type": "object", "properties": { "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": { - "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" } }, @@ -29,10 +33,10 @@ export default { "properties": { "if": { "$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": { - "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": [ @@ -42,7 +46,7 @@ export default { } }, "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": [ { "$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": { - "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" } }, diff --git a/Docs/Schemas/LayerConfigJson.schema.json b/Docs/Schemas/LayerConfigJson.schema.json index ce9499a17..590394514 100644 --- a/Docs/Schemas/LayerConfigJson.schema.json +++ b/Docs/Schemas/LayerConfigJson.schema.json @@ -3,11 +3,11 @@ "type": "object", "properties": { "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" }, "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": [ { "$ref": "#/definitions/Record" @@ -18,7 +18,7 @@ ] }, "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": [ { "$ref": "#/definitions/Record" @@ -29,7 +29,7 @@ ] }, "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": [ { "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." }, "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" } }, @@ -85,18 +85,14 @@ ] }, "calculatedTags": { - "description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to Docs/CalculatedTags.md 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 Docs/CalculatedTags.md 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", "items": { "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": { - "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": [ { "$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": { - "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" }, "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" }, "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" }, "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": { "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": [ @@ -192,11 +188,19 @@ ] }, "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" }, "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", "items": { "type": "object", @@ -238,18 +242,11 @@ } }, "snapToLayer": { - "description": "If specified, these layers will be shown to and the new point will be snapped towards it", - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "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}))", + "type": "array", + "items": { + "type": "string" + } }, "maxSnapDistance": { "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": { - "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": [ { "$ref": "#/definitions/DeleteConfigJson" @@ -363,7 +360,7 @@ ] }, "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": [ { "$ref": "#/definitions/default_3" @@ -374,7 +371,7 @@ ] }, "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" }, "units": { @@ -384,7 +381,7 @@ } }, "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": [ "global", "local", @@ -394,13 +391,9 @@ "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" }, - "popupInFloatover": { - "description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced", - "type": "boolean" - }, "fullNodeDatabase": { "description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden", "type": "boolean" @@ -790,7 +783,7 @@ ] }, "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", "items": { "type": "string" @@ -1623,6 +1616,10 @@ "DeleteConfigJson": { "type": "object", "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": { "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", @@ -1630,10 +1627,10 @@ "type": "object", "properties": { "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": { - "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" } }, @@ -1651,10 +1648,10 @@ "properties": { "if": { "$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": { - "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": [ @@ -1664,7 +1661,7 @@ } }, "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": [ { "$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": { - "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" } }, diff --git a/Docs/Schemas/LayerConfigJsonJSC.ts b/Docs/Schemas/LayerConfigJsonJSC.ts index a9001d594..c2f6b959a 100644 --- a/Docs/Schemas/LayerConfigJsonJSC.ts +++ b/Docs/Schemas/LayerConfigJsonJSC.ts @@ -3,11 +3,11 @@ export default { "type": "object", "properties": { "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" }, "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": [ { "$ref": "#/definitions/Record" @@ -18,7 +18,7 @@ export default { ] }, "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": [ { "$ref": "#/definitions/Record" @@ -29,7 +29,7 @@ export default { ] }, "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": [ { "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." }, "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" } }, @@ -85,18 +85,14 @@ export default { ] }, "calculatedTags": { - "description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to Docs/CalculatedTags.md 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 Docs/CalculatedTags.md 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", "items": { "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": { - "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": [ { "$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": { - "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" }, "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" }, "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" }, "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": { "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": [ @@ -192,11 +188,19 @@ export default { ] }, "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" }, "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", "items": { "type": "object", @@ -238,18 +242,11 @@ export default { } }, "snapToLayer": { - "description": "If specified, these layers will be shown to and the new point will be snapped towards it", - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "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}))", + "type": "array", + "items": { + "type": "string" + } }, "maxSnapDistance": { "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": { - "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": [ { "$ref": "#/definitions/DeleteConfigJson" @@ -363,7 +360,7 @@ export default { ] }, "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": [ { "$ref": "#/definitions/default_3" @@ -374,7 +371,7 @@ export default { ] }, "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" }, "units": { @@ -384,7 +381,7 @@ export default { } }, "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": [ "global", "local", @@ -394,13 +391,9 @@ export default { "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" }, - "popupInFloatover": { - "description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced", - "type": "boolean" - }, "fullNodeDatabase": { "description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden", "type": "boolean" @@ -783,7 +776,7 @@ export default { ] }, "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", "items": { "type": "string" @@ -1607,6 +1600,10 @@ export default { "DeleteConfigJson": { "type": "object", "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": { "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", @@ -1614,10 +1611,10 @@ export default { "type": "object", "properties": { "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": { - "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" } }, @@ -1635,10 +1632,10 @@ export default { "properties": { "if": { "$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": { - "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": [ @@ -1648,7 +1645,7 @@ export default { } }, "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": [ { "$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": { - "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" } } diff --git a/Docs/Schemas/LayoutConfigJson.schema.json b/Docs/Schemas/LayoutConfigJson.schema.json index 0d6dbd54f..4b5b0050d 100644 --- a/Docs/Schemas/LayoutConfigJson.schema.json +++ b/Docs/Schemas/LayoutConfigJson.schema.json @@ -683,7 +683,7 @@ ] }, "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", "items": { "type": "string" @@ -1516,6 +1516,10 @@ "DeleteConfigJson": { "type": "object", "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": { "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", @@ -1523,10 +1527,10 @@ "type": "object", "properties": { "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": { - "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" } }, @@ -1544,10 +1548,10 @@ "properties": { "if": { "$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": { - "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": [ @@ -1557,7 +1561,7 @@ } }, "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": [ { "$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": { - "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" } }, @@ -1700,11 +1700,11 @@ "type": "object", "properties": { "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" }, "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": [ { "$ref": "#/definitions/Record" @@ -1715,7 +1715,7 @@ ] }, "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": [ { "$ref": "#/definitions/Record" @@ -1726,7 +1726,7 @@ ] }, "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": [ { "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." }, "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" } }, @@ -1782,18 +1782,14 @@ ] }, "calculatedTags": { - "description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to Docs/CalculatedTags.md 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 Docs/CalculatedTags.md 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", "items": { "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": { - "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": [ { "$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": { - "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" }, "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" }, "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" }, "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": { "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": [ @@ -1889,11 +1885,19 @@ ] }, "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" }, "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", "items": { "type": "object", @@ -1935,18 +1939,11 @@ } }, "snapToLayer": { - "description": "If specified, these layers will be shown to and the new point will be snapped towards it", - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "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}))", + "type": "array", + "items": { + "type": "string" + } }, "maxSnapDistance": { "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": { - "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": [ { "$ref": "#/definitions/DeleteConfigJson" @@ -2060,7 +2057,7 @@ ] }, "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": [ { "$ref": "#/definitions/default_3" @@ -2071,7 +2068,7 @@ ] }, "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" }, "units": { @@ -2081,7 +2078,7 @@ } }, "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": [ "global", "local", @@ -2091,13 +2088,9 @@ "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" }, - "popupInFloatover": { - "description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced", - "type": "boolean" - }, "fullNodeDatabase": { "description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden", "type": "boolean" @@ -2114,11 +2107,11 @@ "type": "object", "properties": { "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" }, "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": [ { "$ref": "#/definitions/Record" @@ -2129,7 +2122,7 @@ ] }, "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": [ { "$ref": "#/definitions/Record" @@ -2140,7 +2133,7 @@ ] }, "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": [ { "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." }, "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" } }, @@ -2196,18 +2189,14 @@ ] }, "calculatedTags": { - "description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to Docs/CalculatedTags.md 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 Docs/CalculatedTags.md 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", "items": { "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": { - "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": [ { "$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": { - "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" }, "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" }, "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" }, "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": { "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": [ @@ -2303,11 +2292,19 @@ ] }, "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" }, "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", "items": { "type": "object", @@ -2349,18 +2346,11 @@ } }, "snapToLayer": { - "description": "If specified, these layers will be shown to and the new point will be snapped towards it", - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "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}))", + "type": "array", + "items": { + "type": "string" + } }, "maxSnapDistance": { "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": { - "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": [ { "$ref": "#/definitions/DeleteConfigJson" @@ -2474,7 +2464,7 @@ ] }, "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": [ { "$ref": "#/definitions/default_3" @@ -2485,7 +2475,7 @@ ] }, "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" }, "units": { @@ -2495,7 +2485,7 @@ } }, "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": [ "global", "local", @@ -2505,13 +2495,9 @@ "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" }, - "popupInFloatover": { - "description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced", - "type": "boolean" - }, "fullNodeDatabase": { "description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden", "type": "boolean" diff --git a/Docs/Schemas/LayoutConfigJsonJSC.ts b/Docs/Schemas/LayoutConfigJsonJSC.ts index 800fd9a2a..25009278f 100644 --- a/Docs/Schemas/LayoutConfigJsonJSC.ts +++ b/Docs/Schemas/LayoutConfigJsonJSC.ts @@ -676,7 +676,7 @@ export default { ] }, "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", "items": { "type": "string" @@ -1500,6 +1500,10 @@ export default { "DeleteConfigJson": { "type": "object", "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": { "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", @@ -1507,10 +1511,10 @@ export default { "type": "object", "properties": { "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": { - "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" } }, @@ -1528,10 +1532,10 @@ export default { "properties": { "if": { "$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": { - "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": [ @@ -1541,7 +1545,7 @@ export default { } }, "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": [ { "$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": { - "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" } } @@ -1679,11 +1679,11 @@ export default { "type": "object", "properties": { "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" }, "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": [ { "$ref": "#/definitions/Record" @@ -1694,7 +1694,7 @@ export default { ] }, "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": [ { "$ref": "#/definitions/Record" @@ -1705,7 +1705,7 @@ export default { ] }, "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": [ { "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." }, "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" } }, @@ -1761,18 +1761,14 @@ export default { ] }, "calculatedTags": { - "description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to Docs/CalculatedTags.md 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 Docs/CalculatedTags.md 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", "items": { "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": { - "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": [ { "$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": { - "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" }, "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" }, "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" }, "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": { "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": [ @@ -1868,11 +1864,19 @@ export default { ] }, "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" }, "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", "items": { "type": "object", @@ -1914,18 +1918,11 @@ export default { } }, "snapToLayer": { - "description": "If specified, these layers will be shown to and the new point will be snapped towards it", - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "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}))", + "type": "array", + "items": { + "type": "string" + } }, "maxSnapDistance": { "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": { - "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": [ { "$ref": "#/definitions/DeleteConfigJson" @@ -2039,7 +2036,7 @@ export default { ] }, "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": [ { "$ref": "#/definitions/default_3" @@ -2050,7 +2047,7 @@ export default { ] }, "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" }, "units": { @@ -2060,7 +2057,7 @@ export default { } }, "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": [ "global", "local", @@ -2070,13 +2067,9 @@ export default { "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" }, - "popupInFloatover": { - "description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced", - "type": "boolean" - }, "fullNodeDatabase": { "description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden", "type": "boolean" @@ -2092,11 +2085,11 @@ export default { "type": "object", "properties": { "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" }, "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": [ { "$ref": "#/definitions/Record" @@ -2107,7 +2100,7 @@ export default { ] }, "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": [ { "$ref": "#/definitions/Record" @@ -2118,7 +2111,7 @@ export default { ] }, "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": [ { "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." }, "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" } }, @@ -2174,18 +2167,14 @@ export default { ] }, "calculatedTags": { - "description": "A list of extra tags to calculate, specified as \"keyToAssignTo=javascript-expression\".\nThere are a few extra functions available. Refer to Docs/CalculatedTags.md 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 Docs/CalculatedTags.md 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", "items": { "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": { - "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": [ { "$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": { - "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" }, "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" }, "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" }, "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": { "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": [ @@ -2281,11 +2270,19 @@ export default { ] }, "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" }, "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", "items": { "type": "object", @@ -2327,18 +2324,11 @@ export default { } }, "snapToLayer": { - "description": "If specified, these layers will be shown to and the new point will be snapped towards it", - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "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}))", + "type": "array", + "items": { + "type": "string" + } }, "maxSnapDistance": { "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": { - "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": [ { "$ref": "#/definitions/DeleteConfigJson" @@ -2452,7 +2442,7 @@ export default { ] }, "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": [ { "$ref": "#/definitions/default_3" @@ -2463,7 +2453,7 @@ export default { ] }, "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" }, "units": { @@ -2473,7 +2463,7 @@ export default { } }, "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": [ "global", "local", @@ -2483,13 +2473,9 @@ export default { "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" }, - "popupInFloatover": { - "description": "If set, open the selectedElementView in a floatOver instead of on the right\n\ngroup: advanced", - "type": "boolean" - }, "fullNodeDatabase": { "description": "_Set automatically by MapComplete, please ignore_\n\ngroup: hidden", "type": "boolean" diff --git a/Docs/Schemas/MappingConfigJson.schema.json b/Docs/Schemas/MappingConfigJson.schema.json index 86da9e4d3..bbe00d8f8 100644 --- a/Docs/Schemas/MappingConfigJson.schema.json +++ b/Docs/Schemas/MappingConfigJson.schema.json @@ -72,7 +72,7 @@ ] }, "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", "items": { "type": "string" diff --git a/Docs/Schemas/MappingConfigJsonJSC.ts b/Docs/Schemas/MappingConfigJsonJSC.ts index 77517d0a9..d7ce2d1f6 100644 --- a/Docs/Schemas/MappingConfigJsonJSC.ts +++ b/Docs/Schemas/MappingConfigJsonJSC.ts @@ -72,7 +72,7 @@ export default { ] }, "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", "items": { "type": "string" diff --git a/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json b/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json index ace030d38..852905d8c 100644 --- a/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json +++ b/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json @@ -555,7 +555,7 @@ ] }, "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", "items": { "type": "string" diff --git a/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts b/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts index 678dc5db7..25ae705ba 100644 --- a/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts +++ b/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts @@ -548,7 +548,7 @@ export default { ] }, "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", "items": { "type": "string" diff --git a/Docs/Schemas/RewritableConfigJson.schema.json b/Docs/Schemas/RewritableConfigJson.schema.json index 3a3245436..630fabb27 100644 --- a/Docs/Schemas/RewritableConfigJson.schema.json +++ b/Docs/Schemas/RewritableConfigJson.schema.json @@ -411,7 +411,7 @@ ] }, "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", "items": { "type": "string" diff --git a/Docs/Schemas/RewritableConfigJsonJSC.ts b/Docs/Schemas/RewritableConfigJsonJSC.ts index 29053a14c..73d0ae559 100644 --- a/Docs/Schemas/RewritableConfigJsonJSC.ts +++ b/Docs/Schemas/RewritableConfigJsonJSC.ts @@ -404,7 +404,7 @@ export default { ] }, "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", "items": { "type": "string" diff --git a/Models/ThemeConfig/Conversion/FixImages.ts b/Models/ThemeConfig/Conversion/FixImages.ts index 876d298de..909f9987f 100644 --- a/Models/ThemeConfig/Conversion/FixImages.ts +++ b/Models/ThemeConfig/Conversion/FixImages.ts @@ -39,8 +39,9 @@ export class ExtractImages extends Conversion< return ( metapath.type?.some( (t) => - t["$ref"] == "#/definitions/TagRenderingConfigJson" || - t["$ref"] == "#/definitions/QuestionableTagRenderingConfigJson" + t !== null && + (t["$ref"] == "#/definitions/TagRenderingConfigJson" || + t["$ref"] == "#/definitions/QuestionableTagRenderingConfigJson") ) ?? false ) } diff --git a/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts b/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts index 1ff77b85c..5bbef13e9 100644 --- a/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts +++ b/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts @@ -52,6 +52,10 @@ export class UpdateLegacyLayer extends DesugaringStep< delete preset["preciseInput"] } } + + if (typeof preset.snapToLayer === "string") { + preset.snapToLayer = [preset.snapToLayer] + } } if (config.tagRenderings !== undefined) { diff --git a/Models/ThemeConfig/Json/DeleteConfigJson.ts b/Models/ThemeConfig/Json/DeleteConfigJson.ts index 653a040d0..f5828fe17 100644 --- a/Models/ThemeConfig/Json/DeleteConfigJson.ts +++ b/Models/ThemeConfig/Json/DeleteConfigJson.ts @@ -1,6 +1,15 @@ import { TagConfigJson } from "./TagConfigJson" 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: * @@ -18,12 +27,17 @@ export interface DeleteConfigJson { */ 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 /** * 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 + * + * question: What should be added to the changeset as delete reason? */ changesetMessage: string }[] @@ -39,10 +53,14 @@ export interface DeleteConfigJson { /** * The tags that will be given to the object. * This must remove tags so that the 'source/osmTags' won't match anymore + * + * question: What tags should be applied to the object? */ if: TagConfigJson /** * The human explanation for the options + * + * question: What text should be shown to the contributor for this reason? */ 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! * * Example (note that "amenity=" erases the 'amenity'-key alltogether): + * * ``` * { * "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='): + * * ``` * { * "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 - /*** - * 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. * 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 } diff --git a/Models/ThemeConfig/Json/LayerConfigJson.ts b/Models/ThemeConfig/Json/LayerConfigJson.ts index 56aeba28c..4d3b6091a 100644 --- a/Models/ThemeConfig/Json/LayerConfigJson.ts +++ b/Models/ThemeConfig/Json/LayerConfigJson.ts @@ -17,7 +17,7 @@ export interface LayerConfigJson { * The id of this 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? */ 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 * - * group: basic + * group: Basic * question: What is the name of this layer? */ name?: string | Record @@ -36,7 +36,7 @@ export interface LayerConfigJson { * A description for the features shown in this layer. * 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? */ description?: string | Record @@ -54,7 +54,8 @@ export interface LayerConfigJson { * 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 ; - * group: basic + * typesdefault: 0 + * group: Basic */ source: | "special" @@ -71,6 +72,7 @@ export interface LayerConfigJson { * The maximum amount of seconds that a tile is allowed to linger in the cache * * type: nat + * default: 30 days */ maxCacheAge?: number } @@ -128,45 +130,31 @@ export interface LayerConfigJson { * "_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[] - /** - * 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. - * This is useful to hide certain features from view. - * - * The default value is 'yes' + * This is useful to hide certain features from view based on a calculated tag or if the features are provided by a different layer. * + * question: What other tags should features match for being shown? * group: advanced + * ifunset: all features which match the 'source'-specification are shown. */ 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. * 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. * * Default: 0 - * group: basic + * group: Basic * type: nat * 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. @@ -175,8 +163,12 @@ export interface LayerConfigJson { /** * 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 */ shownByDefault?: true | boolean @@ -185,7 +177,7 @@ export interface LayerConfigJson { * The zoom level at which point the data is hidden again * Default: 100 (thus: always visible * - * group: advanced + * group: expert */ minzoomVisible?: number @@ -196,6 +188,19 @@ export interface LayerConfigJson { */ 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. * 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. * This is ideal for decoration, e.g. directions on cameras - * - * group: advanced + * iftrue: Make the features from this layer also available to the other layer; might result in this object being rendered by multiple layers + * iffalse: normal behaviour: don't pass features allong + * question: should this layer pass features to the next layers? + * group: expert */ 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. * 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! * NB: if no presets are defined, the popup to add new points doesn't show up at all * - * group: basic + * group: presets */ presets?: { /** @@ -290,9 +324,16 @@ export interface LayerConfigJson { 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. * 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 * - 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 - - 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 no unread messages (or has a ton of experience) - - The user did not select one of the 'non-delete-options' (see below) - - In all other cases, a 'soft deletion' is used. - - #### 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. - 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 - - #### 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"). - 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. - A no-delete option is offered as 'reason to delete it', but secretly retags. - - group: editing - - */ - deletion?: boolean | DeleteConfigJson + * - It is a 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 no unread messages (or has a ton of experience) + * - The user did not select one of the 'non-delete-options' (see below) + * + * In all other cases, a 'soft deletion' is used. + * + * #### Soft deletion + * + * 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. + * + * 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 + * + * 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!) + * + * 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. + * + * group: editing + * types: use an advanced delete configuration ; boolean + * iftrue: Allow deletion + * 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: * * - It is a point * - 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 + * 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 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 */ allowSplit?: boolean @@ -432,12 +481,9 @@ export interface LayerConfigJson { /** * 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 + * 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" @@ -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 * - * group: special + * group: hidden */ "#"?: 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_ * diff --git a/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts b/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts index c44df3235..93afe1304 100644 --- a/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts +++ b/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts @@ -109,7 +109,7 @@ export interface MappingConfigJson { * { * "if": "crossing:marking=rainbow", * "then": "This is a rainbow crossing", - * "addExtraTags": "not:crossing:marking=" + * "addExtraTags": ["not:crossing:marking="] * } * ``` * diff --git a/Models/ThemeConfig/LayerConfig.ts b/Models/ThemeConfig/LayerConfig.ts index 67d621419..26e2403e2 100644 --- a/Models/ThemeConfig/LayerConfig.ts +++ b/Models/ThemeConfig/LayerConfig.ts @@ -238,13 +238,7 @@ export default class LayerConfig extends WithContextLoader { throw "Layer " + this.id + " still uses the old 'preciseInput'-field" } if (pr.snapToLayer !== undefined) { - let snapToLayers: string[] - if (typeof pr.snapToLayer === "string") { - snapToLayers = [pr.snapToLayer] - } else { - snapToLayers = pr.snapToLayer - } - + let snapToLayers = pr.snapToLayer preciseInput = { snapToLayers, maxSnapDistance: pr.maxSnapDistance ?? 10, diff --git a/UI/InputElement/Helpers/ImageHelper.svelte b/UI/InputElement/Helpers/ImageHelper.svelte new file mode 100644 index 000000000..ff1af6897 --- /dev/null +++ b/UI/InputElement/Helpers/ImageHelper.svelte @@ -0,0 +1,10 @@ + + + diff --git a/UI/InputElement/InputHelpers.ts b/UI/InputElement/InputHelpers.ts index 46c1c9c07..05d1ec379 100644 --- a/UI/InputElement/InputHelpers.ts +++ b/UI/InputElement/InputHelpers.ts @@ -13,6 +13,7 @@ import { Utils } from "../../Utils" import Locale from "../i18n/Locale" import { Feature } from "geojson" import { GeoOperations } from "../../Logic/GeoOperations" +import ImageHelper from "./Helpers/ImageHelper.svelte" export interface InputHelperProperties { /** @@ -55,6 +56,7 @@ export default class InputHelpers { color: (value) => new SvelteUIElement(ColorInput, { value }), opening_hours: (value) => new OpeningHoursInput(value), wikidata: InputHelpers.constructWikidataHelper, + image: (value) => new SvelteUIElement(ImageHelper, { value }), } as const /** @@ -87,6 +89,7 @@ export default class InputHelpers { } return mapProperties } + private static constructWikidataHelper( value: UIEventSource, props: InputHelperProperties diff --git a/UI/InputElement/Validators.ts b/UI/InputElement/Validators.ts index b82a17749..506b5da4f 100644 --- a/UI/InputElement/Validators.ts +++ b/UI/InputElement/Validators.ts @@ -20,7 +20,7 @@ import Combine from "../Base/Combine" import Title from "../Base/Title" import SimpleTagValidator from "./Validators/SimpleTagValidator" import ImageUrlValidator from "./Validators/ImageUrlValidator" -import TagKeyValidator from "./Validators/TagKeyValidator"; +import TagKeyValidator from "./Validators/TagKeyValidator" export type ValidatorType = (typeof Validators.availableTypes)[number] @@ -42,6 +42,9 @@ export default class Validators { "phone", "opening_hours", "color", + "image", + "simple_tag", + "key", ] as const public static readonly AllValidators: ReadonlyArray = [ @@ -63,7 +66,7 @@ export default class Validators { new ColorValidator(), new ImageUrlValidator(), new SimpleTagValidator(), - new TagKeyValidator() + new TagKeyValidator(), ] private static _byType = Validators._byTypeConstructor() diff --git a/UI/Popup/TagRendering/TagRenderingEditable.svelte b/UI/Popup/TagRendering/TagRenderingEditable.svelte index 555cc1452..c0db8b3b6 100644 --- a/UI/Popup/TagRendering/TagRenderingEditable.svelte +++ b/UI/Popup/TagRendering/TagRenderingEditable.svelte @@ -14,7 +14,7 @@ export let config: TagRenderingConfig export let tags: UIEventSource> - export let selectedElement: Feature + export let selectedElement: Feature | undefined export let state: SpecialVisualizationState export let layer: LayerConfig diff --git a/UI/Studio/EditLayer.svelte b/UI/Studio/EditLayer.svelte index 723800b18..604680eb9 100644 --- a/UI/Studio/EditLayer.svelte +++ b/UI/Studio/EditLayer.svelte @@ -8,33 +8,50 @@ import type {ConfigMeta} from "./configMeta"; import {Utils} from "../../Utils"; - + import drinking_water from "../../assets/layers/drinking_water/drinking_water.json" const layerSchema: ConfigMeta[] = layerSchemaRaw let state = new EditLayerState(layerSchema) - const regions = Utils.Dedup(layerSchema.map(meta => meta.hints.group)) - .filter(region => region === "basic") + state.configuration.setData(drinking_water) + /** + * 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 = {} - for (const region of regions) { + for (const region of allNames) { 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)

Edit layer

+
+ {allNames}
General properties
- {#each regions as region} + {#each baselayerRegions as region} + + {/each} + {#each generalTabRegions as region} {/each}
Information panel (questions and answers)
- Information panel (todo) + +
Rendering on the map
@@ -42,3 +59,5 @@ TODO: rendering on the map
+ + diff --git a/UI/Studio/EditLayerState.ts b/UI/Studio/EditLayerState.ts index 21af6a50a..272c17c03 100644 --- a/UI/Studio/EditLayerState.ts +++ b/UI/Studio/EditLayerState.ts @@ -2,6 +2,8 @@ import { OsmConnection } from "../../Logic/Osm/OsmConnection" import { ConfigMeta } from "./configMeta" import { Store, UIEventSource } from "../../Logic/UIEventSource" import { LayerConfigJson } from "../../Models/ThemeConfig/Json/LayerConfigJson" +import { DeleteConfigJson } from "../../Models/ThemeConfig/Json/DeleteConfigJson" +import { Utils } from "../../Utils" export default class EditLayerState { public readonly osmConnection: OsmConnection @@ -19,11 +21,60 @@ export default class EditLayerState { this.featureSwitches = { featureSwitchIsDebugging: new UIEventSource(true), } - this.configuration.addCallback((config) => console.log("Current config is", config)) + this.configuration.addCallback((config) => { + if ( + config?.deletion !== undefined && + (config?.deletion)?.neededChangesets === undefined + ) { + console.trace("Needed changesets is undefined") + } + console.log("Current config is", Utils.Clone(config)) + }) } - public register(path: ReadonlyArray, value: Store) { - value.addCallbackAndRun((v) => { + public getCurrentValueFor(path: ReadonlyArray): any | undefined { + // 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, + value: Store, + 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, v: any) { + { let entry = this.configuration.data for (let i = 0; i < path.length - 1; i++) { const breadcrumb = path[i] @@ -38,20 +89,6 @@ export default class EditLayerState { delete entry[path.at(-1)] } 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)) - ) + } } } diff --git a/UI/Studio/Region.svelte b/UI/Studio/Region.svelte index 1a4d8b2dd..6b90090e6 100644 --- a/UI/Studio/Region.svelte +++ b/UI/Studio/Region.svelte @@ -11,11 +11,19 @@ export let configs: ConfigMeta[] export let title: string +{#if title} +

{title}

+
-

{title}

-
+ {#each configs as config} + + {/each} +
+{:else} +
+ {#each configs as config} + + {/each} +
+{/if} - {#each configs as config} - - {/each} -
diff --git a/UI/Studio/RegisteredTagInput.svelte b/UI/Studio/RegisteredTagInput.svelte index 8b00d8903..c95d48c7e 100644 --- a/UI/Studio/RegisteredTagInput.svelte +++ b/UI/Studio/RegisteredTagInput.svelte @@ -3,16 +3,63 @@ import {UIEventSource} from "../../Logic/UIEventSource"; import type {TagConfigJson} from "../../Models/ThemeConfig/Json/TagConfigJson"; 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 */ - export let path : (string | number)[] - export let state : EditLayerState - - let tag: UIEventSource = new UIEventSource(undefined) - - state.register(path, tag) + export let path: (string | number)[] + export let state: EditLayerState + + export let schema: ConfigMeta + + const initialValue = state.getCurrentValueFor(path) + let tag: UIEventSource = new UIEventSource(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(" ; ") + " }") + } + } + - +{#if mode === "editing"} +
+

{schema.hints.question ?? "What tags should be applied?"}

+ {schema.description} + +
+ + +
+
+{:else} +
+
+ + {schema.path.at(-1)} + {simplify($tag)} +
+ +
+{/if} diff --git a/UI/Studio/SchemaBaseMultiType.svelte b/UI/Studio/SchemaBaseMultiType.svelte index 175224852..3ca53e236 100644 --- a/UI/Studio/SchemaBaseMultiType.svelte +++ b/UI/Studio/SchemaBaseMultiType.svelte @@ -10,7 +10,8 @@ import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig"; import {onDestroy} from "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. */ @@ -18,45 +19,116 @@ export let state: EditLayerState export let path: (string | number)[] = [] export let schema: ConfigMeta - let value = new UIEventSource(undefined) + const defaultOption = schema.hints.typesdefault ? Number(schema.hints.typesdefault) : undefined + const hasBooleanOption = (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 = { id: "TYPE_OF:" + path.join("_"), question: "Which subcategory is needed?", - questionHint: schema.description, - mappings: schema.hints.types.split(";").map(opt => opt.trim()).filter(opt => opt.length > 0).map((opt, i) => ({ + questionHint: nmd(schema.description), + mappings: types.map(opt => opt.trim()).filter(opt => opt.length > 0).map((opt, 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>({}) - 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[] = [] - onDestroy(tags.addCallback(tags => { - chosenOption = Number(tags["value"]) + onDestroy(tags.addCallbackAndRun(tags => { + chosenOption = tags["value"] ? Number(tags["value"]) : defaultOption const type = schema.type[chosenOption] - const cleanPath = path.filter(p => typeof p === "string") + if (!type) { + return + } + if (!type.properties) { + return + } + const cleanPath = path.filter(p => typeof p === "string") for (const crumble of Object.keys(type.properties)) { - console.log("Searching entries for", [...cleanPath, crumble]) subSchemas.push(...(state.getSchema([...cleanPath, crumble]))) } })) + -
- -
- -{#if chosenOption !== undefined} -
- {#each subSchemas as subschema} - {JSON.stringify(subschema)} - - {/each} +
+
+
-{/if} + + {#if chosenOption !== undefined} + {#each subSchemas as subschema} + + {/each} + {/if} +
diff --git a/UI/Studio/SchemaBasedArray.svelte b/UI/Studio/SchemaBasedArray.svelte index cb7dd3203..deb75dc75 100644 --- a/UI/Studio/SchemaBasedArray.svelte +++ b/UI/Studio/SchemaBasedArray.svelte @@ -4,6 +4,7 @@ import {UIEventSource} from "../../Logic/UIEventSource"; import SchemaBasedInput from "./SchemaBasedInput.svelte"; import SchemaBasedField from "./SchemaBasedField.svelte"; + import {TrashIcon} from "@babeard/svelte-heroicons/mini"; export let state: EditLayerState export let schema: ConfigMeta @@ -21,15 +22,22 @@ const subparts = state.getSchemaStartingWith(schema.path) - console.log("Subparts for", schema.path, " are", subparts) - let createdItems = 0 /** * 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 = new UIEventSource([]) + 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() { values.data.push(createdItems) createdItems++ @@ -69,7 +77,12 @@ {/each} {:else} {#each $values as value (value)} -

{singular} {value}

+
+

{singular} {value}

+ +
{#each subparts as subpart} diff --git a/UI/Studio/SchemaBasedField.svelte b/UI/Studio/SchemaBasedField.svelte index c44deff27..add9af8c3 100644 --- a/UI/Studio/SchemaBasedField.svelte +++ b/UI/Studio/SchemaBasedField.svelte @@ -4,10 +4,12 @@ import type {ConfigMeta} from "./configMeta"; import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte"; import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig"; + import nmd from "nano-markdown" import type { QuestionableTagRenderingConfigJson } from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"; import EditLayerState from "./EditLayerState"; + import { onDestroy } from "svelte"; export let state: EditLayerState @@ -15,22 +17,21 @@ export let schema: ConfigMeta let value = new UIEventSource(undefined) - const configJson: QuestionableTagRenderingConfigJson = { id: path.join("_"), - render: schema.hints.inline ?? schema.path.at(-1) + ": {value}", + render: schema.type === "boolean" ? undefined : schema.hints.inline ?? schema.path.at(-1) + ": {value}", question: schema.hints.question, - questionHint: schema.description, - freeform: { + questionHint: nmd(schema.description), + freeform: schema.type === "boolean" ? undefined : { key: "value", type: schema.hints.typehint ?? "string", inline: schema.hints.inline !== undefined - } + }, } if (schema.hints.default) { configJson.mappings = [{ - if: "value=", // +schema.hints.default, + if: "value=", // We leave this blank then: schema.path.at(-1) + " is not set. The default value " + schema.hints.default + " will be used. " + (schema.hints.ifunset ?? ""), }] } else if (!schema.required) { @@ -39,22 +40,58 @@ 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 err: string = undefined try { config = new TagRenderingConfig(configJson, "config based on " + schema.path.join(".")) } catch (e) { console.error(e, config) - err = e + err = path.join(".") + " " + e } - let tags = new UIEventSource>({}) - state.register(path, tags.map(tgs => tgs["value"])) + let startValue = state.getCurrentValueFor(path) + if (startValue?.["en"]) { + startValue = startValue["en"] + } + console.log("Startvalue for", path.join("."), "is", startValue) + let tags = new UIEventSource>({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 + }))) {#if err !== undefined} {err} + {JSON.stringify(schema)} {:else}
- +
{/if} diff --git a/UI/Studio/SchemaBasedInput.svelte b/UI/Studio/SchemaBasedInput.svelte index 1ca1c2ad5..c2e132884 100644 --- a/UI/Studio/SchemaBasedInput.svelte +++ b/UI/Studio/SchemaBasedInput.svelte @@ -16,7 +16,7 @@ {#if schema.type === "array"} {:else if schema.hints.typehint === "tag"} - + {:else if schema.hints.types} {:else} diff --git a/UI/Studio/TagExpression.svelte b/UI/Studio/TagExpression.svelte index 3f8527a75..3c74bdaa6 100644 --- a/UI/Studio/TagExpression.svelte +++ b/UI/Studio/TagExpression.svelte @@ -5,10 +5,8 @@ import {UIEventSource} from "../../Logic/UIEventSource"; import type {TagConfigJson} from "../../Models/ThemeConfig/Json/TagConfigJson"; import BasicTagInput from "./TagInput/BasicTagInput.svelte"; -import {onDestroy} from "svelte"; -import TagInfoStats from "./TagInfoStats.svelte"; import TagInput from "./TagInput/TagInput.svelte"; -import exp from "constants"; +import {TrashIcon} from "@babeard/svelte-heroicons/mini"; export let tag: UIEventSource let mode: "and" | "or" = "and" @@ -39,20 +37,44 @@ function update(_) { } tags.push(t) } - config[mode] = tags - tag.setData(config) + if (tags.length === 1) { + tag.setData(tags[0]) + } else { + config[mode] = tags + tag.setData(config) + } } -function addBasicTag() { - const src = new UIEventSource(undefined) +function addBasicTag(value?: string) { + const src = new UIEventSource(value) basicTags.data.push(src); basicTags.ping() src.addCallbackAndRunD(_ => update(_)) } -function addExpression() { - const src = new UIEventSource(undefined) +function removeTag(basicTag: UIEventSource) { + 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) { + 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.ping() src.addCallbackAndRunD(_ => update(_)) @@ -60,9 +82,40 @@ function addExpression() { $: 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 = (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() @@ -76,19 +129,30 @@ addBasicTag() {/if}
- {#each $basicTags as basicTag} - + {#each $basicTags as basicTag (basicTag)} +
+ + +
{/each} {#each $expressions as expression} - + + + {/each}
- - +
diff --git a/UI/Studio/TagInput/BasicTagInput.svelte b/UI/Studio/TagInput/BasicTagInput.svelte index 4a7f44a02..abd251928 100644 --- a/UI/Studio/TagInput/BasicTagInput.svelte +++ b/UI/Studio/TagInput/BasicTagInput.svelte @@ -10,10 +10,6 @@ export let tag: UIEventSource = new UIEventSource(undefined) export let uploadableOnly: boolean export let overpassSupportNeeded: boolean - tag.addCallback(tag => console.log("Current tag is", tag)) - - console.log({uploadableOnly, overpassSupportNeeded}) - let feedbackGlobal = tag.map(tag => { if (!tag) { @@ -56,6 +52,24 @@ 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(keyValue.addCallbackAndRun(setTag)) @@ -66,25 +80,34 @@ function setTag(_) { const k = keyValue.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) + } } -
+
- - - +
+ + + + +
{#if $feedbackKey} @@ -93,6 +116,5 @@ {:else if $feedbackGlobal} {/if} -
diff --git a/UI/Studio/TagInput/TagInput.svelte b/UI/Studio/TagInput/TagInput.svelte index bd8832f1f..e4ecc5df8 100644 --- a/UI/Studio/TagInput/TagInput.svelte +++ b/UI/Studio/TagInput/TagInput.svelte @@ -12,5 +12,7 @@ export let overpassSupportNeeded: boolean
- + + +
diff --git a/UI/Studio/configMeta.ts b/UI/Studio/configMeta.ts index 69a3d54ae..876ccfc99 100644 --- a/UI/Studio/configMeta.ts +++ b/UI/Studio/configMeta.ts @@ -11,9 +11,13 @@ export interface ConfigMeta { */ types?: string question?: string + iftrue?: string + iffalse?: string ifunset?: string inline?: string default?: string + typesdefault?: string + suggestions?: [] } required: boolean description: string diff --git a/UI/StylesheetTestGui.svelte b/UI/StylesheetTestGui.svelte index 9a0705c00..54308382c 100644 --- a/UI/StylesheetTestGui.svelte +++ b/UI/StylesheetTestGui.svelte @@ -120,6 +120,10 @@ JavaScript
+ +
+ Area with extreme high interactivity due to `border-interactive` +