Chore: regenerate schemas for studio, fix some typing issues

This commit is contained in:
Pieter Vander Vennet 2025-01-19 22:45:24 +01:00
parent 143dd70973
commit 69f5703707
18 changed files with 259 additions and 150 deletions

View file

@ -2,7 +2,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -26,7 +26,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -2,7 +2,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -26,7 +26,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -683,7 +683,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -707,7 +707,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -1072,30 +1072,37 @@
}
},
"iconBadges": {
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\ngroup: hidden",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled\ngroup: hidden",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
"anyOf": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
{
"type": "string"
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
},
"required": [
"if",
"then"
]
}
},

View file

@ -675,7 +675,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -699,7 +699,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -1060,30 +1060,37 @@ export default {
}
},
"iconBadges": {
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\ngroup: hidden",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled\ngroup: hidden",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
"anyOf": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
{
"type": "string"
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
},
"required": [
"if",
"then"
]
}
},

View file

@ -327,7 +327,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -351,7 +351,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -319,7 +319,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -343,7 +343,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -354,7 +354,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -378,7 +378,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -346,7 +346,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -370,7 +370,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -17,30 +17,37 @@
}
},
"iconBadges": {
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\ngroup: hidden",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled\ngroup: hidden",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
"anyOf": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
{
"type": "string"
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
},
"required": [
"if",
"then"
]
}
},
@ -401,7 +408,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -425,7 +432,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -17,30 +17,37 @@ export default {
}
},
"iconBadges": {
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\ngroup: hidden",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled\ngroup: hidden",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
"anyOf": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
{
"type": "string"
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
},
"required": [
"if",
"then"
]
}
},
@ -393,7 +400,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -417,7 +424,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -487,7 +487,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -511,7 +511,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -479,7 +479,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -503,7 +503,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -281,7 +281,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -305,7 +305,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -273,7 +273,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -297,7 +297,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"

View file

@ -556,7 +556,7 @@
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -580,7 +580,7 @@
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -945,30 +945,37 @@
}
},
"iconBadges": {
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\ngroup: hidden",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled\ngroup: hidden",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
"anyOf": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
{
"type": "string"
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
},
"required": [
"if",
"then"
]
}
},

View file

@ -548,7 +548,7 @@ export default {
"type": "object",
"properties": {
"icon": {
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ \"nsi_brand.icon\", \"nsi_operator.icon\", \"id_presets.shop_rendering\", ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"description": "question: What icon should be used?\n\nTo reuse icons from a different layer of a library:\n- The library layer has, within tagRenderings one which will output the URL of the image (e.g. mappings: {\"if\": \"shop=xyz\", then: \"./assets/icons/shop_xyz.png\"})\n- Use \"layer_id.tagrendering_id\"\n\nNote that if you reuse icons from a different icon set, you'll probably want to use `override` to set a default rendering\n\n\ntypes: <span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon\nsuggestions: return [ {\"if\":\"value=nsi_brand.icon\", \"then\": \"Use icons for brand from the Name Suggestion Index\"}, {\"if\":\"value=nsi_operator.icon\", \"then\": \"Use icons for operator from the Name Suggestion Index\"}, {\"if\":\"value=id_presets.shop_rendering\", \"then\": \"Use shop preset icons from iD\"}, ...Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))]",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -572,7 +572,7 @@ export default {
]
},
"color": {
"description": "question: What colour should the icon be?\nThis will only work for the default icons such as `pin`,`circle`,...\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"description": "question: What colour should the icon be?\n\nThis will only work for the default icons such as `pin`,`circle`,...\n\ntypes: <span class=\"text-lg font-bold\">Use a different color depending on the value of some attributes</span> ; color",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
@ -933,30 +933,37 @@ export default {
}
},
"iconBadges": {
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\ngroup: hidden",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\n\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled\ngroup: hidden",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
"anyOf": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
{
"type": "string"
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"$ref": "#/definitions/MinimalTagRenderingConfigJson"
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
},
"required": [
"if",
"then"
]
}
},

View file

@ -1,5 +1,5 @@
<script lang="ts">
import EditLayerState from "./EditLayerState"
import { EditJsonState } from "./EditLayerState"
import type { ConfigMeta } from "./configMeta"
import { UIEventSource } from "../../Logic/UIEventSource"
import type { QuestionableTagRenderingConfigJson } from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
@ -9,13 +9,12 @@
import SchemaBasedInput from "./SchemaBasedInput.svelte"
import type { JsonSchemaType } from "./jsonSchema"
import ShowConversionMessage from "./ShowConversionMessage.svelte"
import type { Translatable } from "../../Models/ThemeConfig/Json/Translatable"
/**
* If 'types' is defined: allow the user to pick one of the types to input.
*/
export let state: EditLayerState
export let state: EditJsonState<any>
export let path: (string | number)[] = []
export let schema: ConfigMeta
let expertMode = state.expertMode
@ -31,8 +30,9 @@
let lastIsString = false
{
const types: string | string[] = Array.isArray(schema.type)
? schema.type[schema.type.length - 1].type
? schema.type[schema.type.length - 1]["type"]
: []
lastIsString = types === "string" || (Array.isArray(types) && types.some((i) => i === "string"))
}
@ -64,6 +64,7 @@
inline: true,
type: schema.hints.typehint,
addExtraTags: ["chosen_type_index="],
helperArgs: []
},
}
let tags = new UIEventSource<Record<string, string>>({})
@ -114,7 +115,7 @@
const type = schema.type[i]
let optionalMatches = 0
for (const key of Object.keys(type.properties ?? {})) {
if (!!existingValue[key]) {
if (existingValue[key]) {
optionalMatches++
}
}

View file

@ -1744,9 +1744,18 @@
"types": "<span class=\"text-lg font-bold\">Use a different icon depending on the value of some attributes</span> ; icon",
"question": "What icon should be used?",
"suggestions": [
"nsi_brand.icon",
"nsi_operator.icon",
"id_presets.shop_rendering",
{
"if": "value=nsi_brand.icon",
"then": "Use icons for brand from the Name Suggestion Index"
},
{
"if": "value=nsi_operator.icon",
"then": "Use icons for operator from the Name Suggestion Index"
},
{
"if": "value=id_presets.shop_rendering",
"then": "Use shop preset icons from iD"
},
{
"if": "value=addSmall",
"then": "addSmall",
@ -2294,8 +2303,65 @@
"hints": {
"group": "hidden"
},
"type": "array",
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle"
"type": [
{
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag"
},
"then": {
"description": "Badge to show\nType: icon",
"anyOf": [
{
"description": "Mostly used for lineRendering and pointRendering",
"type": "object",
"properties": {
"render": {
"description": "question: What value should be shown (if no predefined option matches)?\n\nThis piece of text will be shown in the infobox.\nNote that \"&LBRACEkey&RBRACE\"-parts are substituted by the corresponding values of the element.\n\nThis value will be used if there is no mapping which matches (or there are no matches)\nNote that this is a HTML-interpreted value, so you can add links as e.g. '&lt;a href='{website}'>{website}&lt;/a>' or include images such as `This is of type A &lt;br>&lt;img src='typeA-icon.svg' />`",
"type": "string"
},
"mappings": {
"description": "Allows fixed-tag inputs, shown either as radiobuttons or as checkboxes",
"type": "array",
"items": {
"type": "object",
"properties": {
"if": {
"$ref": "#/definitions/TagConfigJson",
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
},
"then": {
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option",
"type": "string"
}
},
"required": [
"if",
"then"
]
}
}
},
"additionalProperties": false
},
{
"type": "string"
}
]
}
},
"required": [
"if",
"then"
]
},
{
"type": "string"
}
],
"description": "A list of extra badges to show next to the icon as small badge\nThey will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout.\nNote: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle\nAlternatively, this can reuse a _tagRendering_ from another layer, e.g. one of the 'icons'-tagrenderings.\nSee ExpandIconBadges on how this is handled"
},
{
"path": [