forked from MapComplete/MapComplete
Add extraLink button which replaced the iframePopout button, fix #654
This commit is contained in:
parent
e04e7ddf6a
commit
c941f567cf
16 changed files with 457 additions and 113 deletions
|
@ -187,10 +187,10 @@
|
|||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_3"
|
||||
"$ref": "#/definitions/default_4"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/default_4"
|
||||
"$ref": "#/definitions/default_5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -378,7 +378,7 @@
|
|||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default"
|
||||
"$ref": "#/definitions/default_1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -409,7 +409,7 @@
|
|||
"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.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_2"
|
||||
"$ref": "#/definitions/default_3"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
|
@ -424,7 +424,7 @@
|
|||
"description": "In some cases, a value is represented in a certain unit (such as meters for heigt/distance/..., km/h for speed, ...)\n\nSometimes, multiple denominations are possible (e.g. km/h vs mile/h; megawatt vs kilowatt vs gigawatt for power generators, ...)\n\nThis brings in some troubles, as there are multiple ways to write it (no denomitation, 'm' vs 'meter' 'metre', ...)\n\nNot only do we want to write consistent data to OSM, we also want to present this consistently to the user.\nThis is handled by defining units.\n\n# Rendering\n\nTo render a value with long (human) denomination, use {canonical(key)}\n\n# Usage\n\nFirst of all, you define which keys have units applied, for example:\n\n```\nunits: [\n appliesTo: [\"maxspeed\", \"maxspeed:hgv\", \"maxspeed:bus\"]\n applicableUnits: [\n ...\n ]\n]\n```\n\nApplicableUnits defines which is the canonical extension, how it is presented to the user, ...:\n\n```\napplicableUnits: [\n{\n canonicalDenomination: \"km/h\",\n alternativeDenomination: [\"km/u\", \"kmh\", \"kph\"]\n default: true,\n human: {\n en: \"kilometer/hour\",\n nl: \"kilometer/uur\"\n },\n humanShort: {\n en: \"km/h\",\n nl: \"km/u\"\n }\n},\n{\n canoncialDenomination: \"mph\",\n ... similar for miles an hour ...\n}\n]\n```\n\n\nIf this is defined, then every key which the denominations apply to (`maxspeed`, `maxspeed:hgv` and `maxspeed:bus`) will be rewritten at the metatagging stage:\nevery value will be parsed and the canonical extension will be added add presented to the other parts of the code.\n\nAlso, if a freeform text field is used, an extra dropdown with applicable denominations will be given",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default_1"
|
||||
"$ref": "#/definitions/default_2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -650,7 +650,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_3": {
|
||||
"default_4": {
|
||||
"description": "The PointRenderingConfig gives all details onto how to render a single point of a feature.\n\nThis can be used if:\n\n- The feature is a point\n- To render something at the centroid of an area, or at the start, end or projected centroid of a way",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -745,7 +745,7 @@
|
|||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_4": {
|
||||
"default_5": {
|
||||
"description": "The LineRenderingConfig gives all details onto how to render a single line of a feature.\n\nThis can be used if:\n\n- The feature is a line\n- The feature is an area",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -836,7 +836,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default": {
|
||||
"default_1": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
@ -951,7 +951,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_2": {
|
||||
"default_3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enableImproveAccuracy": {
|
||||
|
@ -965,7 +965,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_1": {
|
||||
"default_2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"appliesToKey": {
|
||||
|
|
|
@ -187,10 +187,10 @@ export default {
|
|||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_3"
|
||||
"$ref": "#/definitions/default_4"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/default_4"
|
||||
"$ref": "#/definitions/default_5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ export default {
|
|||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default"
|
||||
"$ref": "#/definitions/default_1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ export default {
|
|||
"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.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_2"
|
||||
"$ref": "#/definitions/default_3"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
|
@ -424,7 +424,7 @@ export default {
|
|||
"description": "In some cases, a value is represented in a certain unit (such as meters for heigt/distance/..., km/h for speed, ...)\n\nSometimes, multiple denominations are possible (e.g. km/h vs mile/h; megawatt vs kilowatt vs gigawatt for power generators, ...)\n\nThis brings in some troubles, as there are multiple ways to write it (no denomitation, 'm' vs 'meter' 'metre', ...)\n\nNot only do we want to write consistent data to OSM, we also want to present this consistently to the user.\nThis is handled by defining units.\n\n# Rendering\n\nTo render a value with long (human) denomination, use {canonical(key)}\n\n# Usage\n\nFirst of all, you define which keys have units applied, for example:\n\n```\nunits: [\n appliesTo: [\"maxspeed\", \"maxspeed:hgv\", \"maxspeed:bus\"]\n applicableUnits: [\n ...\n ]\n]\n```\n\nApplicableUnits defines which is the canonical extension, how it is presented to the user, ...:\n\n```\napplicableUnits: [\n{\n canonicalDenomination: \"km/h\",\n alternativeDenomination: [\"km/u\", \"kmh\", \"kph\"]\n default: true,\n human: {\n en: \"kilometer/hour\",\n nl: \"kilometer/uur\"\n },\n humanShort: {\n en: \"km/h\",\n nl: \"km/u\"\n }\n},\n{\n canoncialDenomination: \"mph\",\n ... similar for miles an hour ...\n}\n]\n```\n\n\nIf this is defined, then every key which the denominations apply to (`maxspeed`, `maxspeed:hgv` and `maxspeed:bus`) will be rewritten at the metatagging stage:\nevery value will be parsed and the canonical extension will be added add presented to the other parts of the code.\n\nAlso, if a freeform text field is used, an extra dropdown with applicable denominations will be given",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default_1"
|
||||
"$ref": "#/definitions/default_2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -647,7 +647,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_3": {
|
||||
"default_4": {
|
||||
"description": "The PointRenderingConfig gives all details onto how to render a single point of a feature.\n\nThis can be used if:\n\n- The feature is a point\n- To render something at the centroid of an area, or at the start, end or projected centroid of a way",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -741,7 +741,7 @@ export default {
|
|||
"location"
|
||||
]
|
||||
},
|
||||
"default_4": {
|
||||
"default_5": {
|
||||
"description": "The LineRenderingConfig gives all details onto how to render a single line of a feature.\n\nThis can be used if:\n\n- The feature is a line\n- The feature is an area",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -831,7 +831,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"default_1": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
@ -944,7 +944,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_2": {
|
||||
"default_3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enableImproveAccuracy": {
|
||||
|
@ -957,7 +957,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_1": {
|
||||
"default_2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"appliesToKey": {
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
"description": "Define some (overlay) slippy map tilesources",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default_5"
|
||||
"$ref": "#/definitions/default_6"
|
||||
}
|
||||
},
|
||||
"layers": {
|
||||
|
@ -204,43 +204,56 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"extraLink": {
|
||||
"description": "Adds an additional button on the top-left of the application.\nThis can link to an arbitrary location.\n\nNote that {lat},{lon},{zoom}, {language} and {theme} will be replaced\n\nDefault: {icon: \"./assets/svg/pop-out.svg\", href: 'https://mapcomplete.osm.be/{theme}.html?lat={lat}&lon={lon}&z={zoom}, requirements: [\"iframe\",\"no-welcome-message]},",
|
||||
"$ref": "#/definitions/default"
|
||||
},
|
||||
"enableUserBadge": {
|
||||
"description": "If set to false, disables logging in.\nThe userbadge will be hidden, all login-buttons will be hidden and editing will be disabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableShareScreen": {
|
||||
"description": "If false, hides the tab 'share'-tab in the welcomeMessage",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableMoreQuests": {
|
||||
"description": "Hides the tab with more themes in the welcomeMessage",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableLayers": {
|
||||
"description": "If false, the layer selection/filter view will be hidden\nThe corresponding URL-parameter is 'fs-filters' instead of 'fs-layers'",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableSearch": {
|
||||
"description": "If set to false, hides the search bar",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableAddNewPoints": {
|
||||
"description": "If set to false, the ability to add new points or nodes will be disabled.\nEditing already existing features will still be possible",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableGeolocation": {
|
||||
"description": "If set to false, the 'geolocation'-button will be hidden.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableBackgroundLayerSelection": {
|
||||
"description": "Enable switching the backgroundlayer.\nIf false, the quickswitch-buttons are removed (bottom left) and the dropdown in the layer selection is removed as well",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableShowAllQuestions": {
|
||||
"description": "If set to true, will show _all_ unanswered questions in a popup instead of just the next one",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableDownload": {
|
||||
"description": "If set to true, download button for the data will be shown (offers downloading as geojson and csv)",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enablePdfDownload": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableIframePopout": {
|
||||
"description": "If set to true, exporting a pdf is enabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableNoteImports": {
|
||||
"description": "If true, notes will be loaded and parsed. If a note is an import (as created by the import_helper.html-tool from mapcomplete),\nthese notes will be shown if a relevant layer is present.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"overpassUrl": {
|
||||
|
@ -491,7 +504,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_3": {
|
||||
"default_4": {
|
||||
"description": "The PointRenderingConfig gives all details onto how to render a single point of a feature.\n\nThis can be used if:\n\n- The feature is a point\n- To render something at the centroid of an area, or at the start, end or projected centroid of a way",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -586,7 +599,7 @@
|
|||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_4": {
|
||||
"default_5": {
|
||||
"description": "The LineRenderingConfig gives all details onto how to render a single line of a feature.\n\nThis can be used if:\n\n- The feature is a line\n- The feature is an area",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -677,7 +690,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default": {
|
||||
"default_1": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
@ -792,7 +805,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_2": {
|
||||
"default_3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enableImproveAccuracy": {
|
||||
|
@ -806,7 +819,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_1": {
|
||||
"default_2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"appliesToKey": {
|
||||
|
@ -834,7 +847,7 @@
|
|||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_5": {
|
||||
"default_6": {
|
||||
"description": "Configuration for a tilesource config",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -1062,10 +1075,10 @@
|
|||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_3"
|
||||
"$ref": "#/definitions/default_4"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/default_4"
|
||||
"$ref": "#/definitions/default_5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1253,7 +1266,7 @@
|
|||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default"
|
||||
"$ref": "#/definitions/default_1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1284,7 +1297,7 @@
|
|||
"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.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_2"
|
||||
"$ref": "#/definitions/default_3"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
|
@ -1299,7 +1312,7 @@
|
|||
"description": "In some cases, a value is represented in a certain unit (such as meters for heigt/distance/..., km/h for speed, ...)\n\nSometimes, multiple denominations are possible (e.g. km/h vs mile/h; megawatt vs kilowatt vs gigawatt for power generators, ...)\n\nThis brings in some troubles, as there are multiple ways to write it (no denomitation, 'm' vs 'meter' 'metre', ...)\n\nNot only do we want to write consistent data to OSM, we also want to present this consistently to the user.\nThis is handled by defining units.\n\n# Rendering\n\nTo render a value with long (human) denomination, use {canonical(key)}\n\n# Usage\n\nFirst of all, you define which keys have units applied, for example:\n\n```\nunits: [\n appliesTo: [\"maxspeed\", \"maxspeed:hgv\", \"maxspeed:bus\"]\n applicableUnits: [\n ...\n ]\n]\n```\n\nApplicableUnits defines which is the canonical extension, how it is presented to the user, ...:\n\n```\napplicableUnits: [\n{\n canonicalDenomination: \"km/h\",\n alternativeDenomination: [\"km/u\", \"kmh\", \"kph\"]\n default: true,\n human: {\n en: \"kilometer/hour\",\n nl: \"kilometer/uur\"\n },\n humanShort: {\n en: \"km/h\",\n nl: \"km/u\"\n }\n},\n{\n canoncialDenomination: \"mph\",\n ... similar for miles an hour ...\n}\n]\n```\n\n\nIf this is defined, then every key which the denominations apply to (`maxspeed`, `maxspeed:hgv` and `maxspeed:bus`) will be rewritten at the metatagging stage:\nevery value will be parsed and the canonical extension will be added add presented to the other parts of the code.\n\nAlso, if a freeform text field is used, an extra dropdown with applicable denominations will be given",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default_1"
|
||||
"$ref": "#/definitions/default_2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1309,6 +1322,37 @@
|
|||
"source"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"text": {},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
"newTab": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"iframe",
|
||||
"no-iframe",
|
||||
"no-welcome-message",
|
||||
"welcome-message"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"href"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
|
|
|
@ -78,7 +78,7 @@ export default {
|
|||
"description": "Define some (overlay) slippy map tilesources",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default_5"
|
||||
"$ref": "#/definitions/default_6"
|
||||
}
|
||||
},
|
||||
"layers": {
|
||||
|
@ -204,43 +204,56 @@ export default {
|
|||
}
|
||||
]
|
||||
},
|
||||
"extraLink": {
|
||||
"description": "Adds an additional button on the top-left of the application.\nThis can link to an arbitrary location.\n\nNote that {lat},{lon},{zoom}, {language} and {theme} will be replaced\n\nDefault: {icon: \"./assets/svg/pop-out.svg\", href: 'https://mapcomplete.osm.be/{theme}.html?lat={lat}&lon={lon}&z={zoom}, requirements: [\"iframe\",\"no-welcome-message]},",
|
||||
"$ref": "#/definitions/default"
|
||||
},
|
||||
"enableUserBadge": {
|
||||
"description": "If set to false, disables logging in.\nThe userbadge will be hidden, all login-buttons will be hidden and editing will be disabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableShareScreen": {
|
||||
"description": "If false, hides the tab 'share'-tab in the welcomeMessage",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableMoreQuests": {
|
||||
"description": "Hides the tab with more themes in the welcomeMessage",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableLayers": {
|
||||
"description": "If false, the layer selection/filter view will be hidden\nThe corresponding URL-parameter is 'fs-filters' instead of 'fs-layers'",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableSearch": {
|
||||
"description": "If set to false, hides the search bar",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableAddNewPoints": {
|
||||
"description": "If set to false, the ability to add new points or nodes will be disabled.\nEditing already existing features will still be possible",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableGeolocation": {
|
||||
"description": "If set to false, the 'geolocation'-button will be hidden.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableBackgroundLayerSelection": {
|
||||
"description": "Enable switching the backgroundlayer.\nIf false, the quickswitch-buttons are removed (bottom left) and the dropdown in the layer selection is removed as well",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableShowAllQuestions": {
|
||||
"description": "If set to true, will show _all_ unanswered questions in a popup instead of just the next one",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableDownload": {
|
||||
"description": "If set to true, download button for the data will be shown (offers downloading as geojson and csv)",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enablePdfDownload": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableIframePopout": {
|
||||
"description": "If set to true, exporting a pdf is enabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"enableNoteImports": {
|
||||
"description": "If true, notes will be loaded and parsed. If a note is an import (as created by the import_helper.html-tool from mapcomplete),\nthese notes will be shown if a relevant layer is present.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"overpassUrl": {
|
||||
|
@ -488,7 +501,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_3": {
|
||||
"default_4": {
|
||||
"description": "The PointRenderingConfig gives all details onto how to render a single point of a feature.\n\nThis can be used if:\n\n- The feature is a point\n- To render something at the centroid of an area, or at the start, end or projected centroid of a way",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -582,7 +595,7 @@ export default {
|
|||
"location"
|
||||
]
|
||||
},
|
||||
"default_4": {
|
||||
"default_5": {
|
||||
"description": "The LineRenderingConfig gives all details onto how to render a single line of a feature.\n\nThis can be used if:\n\n- The feature is a line\n- The feature is an area",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -672,7 +685,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"default_1": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
@ -785,7 +798,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_2": {
|
||||
"default_3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enableImproveAccuracy": {
|
||||
|
@ -798,7 +811,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_1": {
|
||||
"default_2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"appliesToKey": {
|
||||
|
@ -825,7 +838,7 @@ export default {
|
|||
"appliesToKey"
|
||||
]
|
||||
},
|
||||
"default_5": {
|
||||
"default_6": {
|
||||
"description": "Configuration for a tilesource config",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -1052,10 +1065,10 @@ export default {
|
|||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_3"
|
||||
"$ref": "#/definitions/default_4"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/default_4"
|
||||
"$ref": "#/definitions/default_5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1243,7 +1256,7 @@ export default {
|
|||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default"
|
||||
"$ref": "#/definitions/default_1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1274,7 +1287,7 @@ export default {
|
|||
"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.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/default_2"
|
||||
"$ref": "#/definitions/default_3"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
|
@ -1289,7 +1302,7 @@ export default {
|
|||
"description": "In some cases, a value is represented in a certain unit (such as meters for heigt/distance/..., km/h for speed, ...)\n\nSometimes, multiple denominations are possible (e.g. km/h vs mile/h; megawatt vs kilowatt vs gigawatt for power generators, ...)\n\nThis brings in some troubles, as there are multiple ways to write it (no denomitation, 'm' vs 'meter' 'metre', ...)\n\nNot only do we want to write consistent data to OSM, we also want to present this consistently to the user.\nThis is handled by defining units.\n\n# Rendering\n\nTo render a value with long (human) denomination, use {canonical(key)}\n\n# Usage\n\nFirst of all, you define which keys have units applied, for example:\n\n```\nunits: [\n appliesTo: [\"maxspeed\", \"maxspeed:hgv\", \"maxspeed:bus\"]\n applicableUnits: [\n ...\n ]\n]\n```\n\nApplicableUnits defines which is the canonical extension, how it is presented to the user, ...:\n\n```\napplicableUnits: [\n{\n canonicalDenomination: \"km/h\",\n alternativeDenomination: [\"km/u\", \"kmh\", \"kph\"]\n default: true,\n human: {\n en: \"kilometer/hour\",\n nl: \"kilometer/uur\"\n },\n humanShort: {\n en: \"km/h\",\n nl: \"km/u\"\n }\n},\n{\n canoncialDenomination: \"mph\",\n ... similar for miles an hour ...\n}\n]\n```\n\n\nIf this is defined, then every key which the denominations apply to (`maxspeed`, `maxspeed:hgv` and `maxspeed:bus`) will be rewritten at the metatagging stage:\nevery value will be parsed and the canonical extension will be added add presented to the other parts of the code.\n\nAlso, if a freeform text field is used, an extra dropdown with applicable denominations will be given",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default_1"
|
||||
"$ref": "#/definitions/default_2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1298,6 +1311,36 @@ export default {
|
|||
"mapRendering",
|
||||
"source"
|
||||
]
|
||||
},
|
||||
"default": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"text": {},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
"newTab": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"iframe",
|
||||
"no-iframe",
|
||||
"no-welcome-message",
|
||||
"welcome-message"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"href"
|
||||
]
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
|
|
|
@ -252,7 +252,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_3": {
|
||||
"default_4": {
|
||||
"description": "The PointRenderingConfig gives all details onto how to render a single point of a feature.\n\nThis can be used if:\n\n- The feature is a point\n- To render something at the centroid of an area, or at the start, end or projected centroid of a way",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -347,7 +347,7 @@
|
|||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_4": {
|
||||
"default_5": {
|
||||
"description": "The LineRenderingConfig gives all details onto how to render a single line of a feature.\n\nThis can be used if:\n\n- The feature is a line\n- The feature is an area",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -438,7 +438,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default": {
|
||||
"default_1": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
@ -553,7 +553,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_2": {
|
||||
"default_3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enableImproveAccuracy": {
|
||||
|
@ -567,7 +567,7 @@
|
|||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"default_1": {
|
||||
"default_2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"appliesToKey": {
|
||||
|
|
|
@ -249,7 +249,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_3": {
|
||||
"default_4": {
|
||||
"description": "The PointRenderingConfig gives all details onto how to render a single point of a feature.\n\nThis can be used if:\n\n- The feature is a point\n- To render something at the centroid of an area, or at the start, end or projected centroid of a way",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -343,7 +343,7 @@ export default {
|
|||
"location"
|
||||
]
|
||||
},
|
||||
"default_4": {
|
||||
"default_5": {
|
||||
"description": "The LineRenderingConfig gives all details onto how to render a single line of a feature.\n\nThis can be used if:\n\n- The feature is a line\n- The feature is an area",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -433,7 +433,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"default_1": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
@ -546,7 +546,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_2": {
|
||||
"default_3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enableImproveAccuracy": {
|
||||
|
@ -559,7 +559,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
"default_1": {
|
||||
"default_2": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"appliesToKey": {
|
||||
|
|
|
@ -19,7 +19,7 @@ export default class FeatureSwitchState {
|
|||
public readonly featureSwitchBackgroundSelection: UIEventSource<boolean>;
|
||||
public readonly featureSwitchAddNew: UIEventSource<boolean>;
|
||||
public readonly featureSwitchWelcomeMessage: UIEventSource<boolean>;
|
||||
public readonly featureSwitchIframePopoutEnabled: UIEventSource<boolean>;
|
||||
public readonly featureSwitchExtraLinkEnabled: UIEventSource<boolean>;
|
||||
public readonly featureSwitchMoreQuests: UIEventSource<boolean>;
|
||||
public readonly featureSwitchShareScreen: UIEventSource<boolean>;
|
||||
public readonly featureSwitchGeolocation: UIEventSource<boolean>;
|
||||
|
@ -81,7 +81,7 @@ export default class FeatureSwitchState {
|
|||
this.featureSwitchFilter = featSw(
|
||||
"fs-filter",
|
||||
(layoutToUse) => layoutToUse?.enableLayers ?? true,
|
||||
"Disables/Enables the filter"
|
||||
"Disables/Enables the filter view"
|
||||
);
|
||||
this.featureSwitchAddNew = featSw(
|
||||
"fs-add-new",
|
||||
|
@ -93,10 +93,10 @@ export default class FeatureSwitchState {
|
|||
() => true,
|
||||
"Disables/enables the help menu or welcome message"
|
||||
);
|
||||
this.featureSwitchIframePopoutEnabled = featSw(
|
||||
this.featureSwitchExtraLinkEnabled = featSw(
|
||||
"fs-iframe-popout",
|
||||
(layoutToUse) => layoutToUse?.enableIframePopout,
|
||||
"Disables/Enables the iframe-popout button. If in iframe mode and the welcome message is hidden, a popout button to the full mapcomplete instance is shown instead (unless disabled with this switch)"
|
||||
_ => true,
|
||||
"Disables/Enables the extraLink button. By default, if in iframe mode and the welcome message is hidden, a popout button to the full mapcomplete instance is shown instead (unless disabled with this switch or another extraLink button is enabled)"
|
||||
);
|
||||
this.featureSwitchMoreQuests = featSw(
|
||||
"fs-more-quests",
|
||||
|
|
31
Models/ThemeConfig/ExtraLinkConfig.ts
Normal file
31
Models/ThemeConfig/ExtraLinkConfig.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import ExtraLinkConfigJson from "./Json/ExtraLinkConfigJson";
|
||||
import {Translation} from "../../UI/i18n/Translation";
|
||||
import Translations from "../../UI/i18n/Translations";
|
||||
|
||||
export default class ExtraLinkConfig {
|
||||
public readonly icon?: string
|
||||
public readonly text?: Translation
|
||||
public readonly href: string
|
||||
public readonly newTab?: false | boolean
|
||||
public readonly requirements?: Set<("iframe" | "no-iframe" | "welcome-message" | "no-welcome-message")>
|
||||
|
||||
constructor(configJson: ExtraLinkConfigJson, context) {
|
||||
this.icon = configJson.icon
|
||||
this.text = Translations.T(configJson.text)
|
||||
this.href = configJson.href
|
||||
this.newTab = configJson.newTab
|
||||
this.requirements = new Set(configJson.requirements)
|
||||
|
||||
for (let requirement of configJson.requirements) {
|
||||
|
||||
if (this.requirements.has(<any>("no-" + requirement))) {
|
||||
throw "Conflicting requirements found for " + context + ".extraLink: both '" + requirement + "' and 'no-" + requirement + "' found"
|
||||
}
|
||||
}
|
||||
|
||||
if (this.icon === undefined && this.text === undefined) {
|
||||
throw "At " + context + ".extraLink: define at least an icon or a text to show. Both are undefined, this is not allowed"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
7
Models/ThemeConfig/Json/ExtraLinkConfigJson.ts
Normal file
7
Models/ThemeConfig/Json/ExtraLinkConfigJson.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default interface ExtraLinkConfigJson {
|
||||
icon?: string,
|
||||
text?: string | any,
|
||||
href: string,
|
||||
newTab?: false | boolean,
|
||||
requirements?: ("iframe" | "no-iframe" | "welcome-message" | "no-welcome-message")[]
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
import {LayerConfigJson} from "./LayerConfigJson";
|
||||
import TilesourceConfigJson from "./TilesourceConfigJson";
|
||||
import ExtraLinkConfigJson from "./ExtraLinkConfigJson";
|
||||
|
||||
/**
|
||||
* Defines the entire theme.
|
||||
|
@ -244,18 +245,70 @@ export interface LayoutConfigJson {
|
|||
*/
|
||||
lockLocation?: [[number, number], [number, number]] | number[][];
|
||||
|
||||
enableUserBadge?: boolean;
|
||||
enableShareScreen?: boolean;
|
||||
enableMoreQuests?: boolean;
|
||||
enableLayers?: boolean;
|
||||
enableSearch?: boolean;
|
||||
enableAddNewPoints?: boolean;
|
||||
enableGeolocation?: boolean;
|
||||
enableBackgroundLayerSelection?: boolean;
|
||||
enableShowAllQuestions?: boolean;
|
||||
enableDownload?: boolean;
|
||||
enablePdfDownload?: boolean;
|
||||
enableIframePopout?: true | boolean;
|
||||
/**
|
||||
* Adds an additional button on the top-left of the application.
|
||||
* This can link to an arbitrary location.
|
||||
*
|
||||
* Note that {lat},{lon},{zoom}, {language} and {theme} will be replaced
|
||||
*
|
||||
* Default: {icon: "./assets/svg/pop-out.svg", href: 'https://mapcomplete.osm.be/{theme}.html?lat={lat}&lon={lon}&z={zoom}, requirements: ["iframe","no-welcome-message]},
|
||||
*
|
||||
*/
|
||||
extraLink?: ExtraLinkConfigJson
|
||||
|
||||
/**
|
||||
* If set to false, disables logging in.
|
||||
* The userbadge will be hidden, all login-buttons will be hidden and editing will be disabled
|
||||
*/
|
||||
enableUserBadge?: true | boolean;
|
||||
/**
|
||||
* If false, hides the tab 'share'-tab in the welcomeMessage
|
||||
*/
|
||||
enableShareScreen?: true | boolean;
|
||||
/**
|
||||
* Hides the tab with more themes in the welcomeMessage
|
||||
*/
|
||||
enableMoreQuests?: true | boolean;
|
||||
/**
|
||||
* If false, the layer selection/filter view will be hidden
|
||||
* The corresponding URL-parameter is 'fs-filters' instead of 'fs-layers'
|
||||
*/
|
||||
enableLayers?: true | boolean;
|
||||
/**
|
||||
* If set to false, hides the search bar
|
||||
*/
|
||||
enableSearch?: true | boolean;
|
||||
/**
|
||||
* If set to false, the ability to add new points or nodes will be disabled.
|
||||
* Editing already existing features will still be possible
|
||||
*/
|
||||
enableAddNewPoints?: true | boolean;
|
||||
/**
|
||||
* If set to false, the 'geolocation'-button will be hidden.
|
||||
*/
|
||||
enableGeolocation?: true | boolean;
|
||||
/**
|
||||
* Enable switching the backgroundlayer.
|
||||
* If false, the quickswitch-buttons are removed (bottom left) and the dropdown in the layer selection is removed as well
|
||||
*/
|
||||
enableBackgroundLayerSelection?: true | boolean;
|
||||
/**
|
||||
* If set to true, will show _all_ unanswered questions in a popup instead of just the next one
|
||||
*/
|
||||
enableShowAllQuestions?: false | boolean;
|
||||
/**
|
||||
* If set to true, download button for the data will be shown (offers downloading as geojson and csv)
|
||||
*/
|
||||
enableDownload?: false | boolean;
|
||||
/**
|
||||
* If set to true, exporting a pdf is enabled
|
||||
*/
|
||||
enablePdfDownload?: false | boolean;
|
||||
|
||||
/**
|
||||
* If true, notes will be loaded and parsed. If a note is an import (as created by the import_helper.html-tool from mapcomplete),
|
||||
* these notes will be shown if a relevant layer is present.
|
||||
*/
|
||||
enableNoteImports?: true | boolean;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import {LayerConfigJson} from "./Json/LayerConfigJson";
|
|||
import Constants from "../Constants";
|
||||
import TilesourceConfig from "./TilesourceConfig";
|
||||
import {ExtractImages} from "./Conversion/FixImages";
|
||||
import ExtraLinkConfig from "./ExtraLinkConfig";
|
||||
|
||||
export default class LayoutConfig {
|
||||
public readonly id: string;
|
||||
|
@ -42,7 +43,6 @@ export default class LayoutConfig {
|
|||
public readonly enableShowAllQuestions: boolean;
|
||||
public readonly enableExportButton: boolean;
|
||||
public readonly enablePdfDownload: boolean;
|
||||
public readonly enableIframePopout: boolean;
|
||||
|
||||
public readonly customCss?: string;
|
||||
|
||||
|
@ -51,8 +51,9 @@ export default class LayoutConfig {
|
|||
public readonly overpassMaxZoom: number
|
||||
public readonly osmApiTileSize: number
|
||||
public readonly official: boolean;
|
||||
|
||||
public readonly usedImages : string[]
|
||||
|
||||
public readonly usedImages: string[]
|
||||
public readonly extraLink?: ExtraLinkConfig
|
||||
|
||||
constructor(json: LayoutConfigJson, official = true, context?: string) {
|
||||
this.official = official;
|
||||
|
@ -70,7 +71,7 @@ export default class LayoutConfig {
|
|||
this.credits = json.credits;
|
||||
this.version = json.version;
|
||||
this.language = json.mustHaveLanguage ?? Array.from(Object.keys(json.title));
|
||||
this.usedImages =Array.from( new ExtractImages().convertStrict(json, "while extracting the images of "+json.id+" "+context??"")).sort()
|
||||
this.usedImages = Array.from(new ExtractImages().convertStrict(json, "while extracting the images of " + json.id + " " + context ?? "")).sort()
|
||||
{
|
||||
if (typeof json.title === "string") {
|
||||
throw `The title of a theme should always be a translation, as it sets the corresponding languages (${context}.title). The themenID is ${this.id}; the offending object is ${JSON.stringify(json.title)} which is a ${typeof json.title})`
|
||||
|
@ -118,6 +119,13 @@ export default class LayoutConfig {
|
|||
// At this point, layers should be expanded and validated either by the generateScript or the LegacyJsonConvert
|
||||
this.layers = json.layers.map(lyrJson => new LayerConfig(<LayerConfigJson>lyrJson, json.id + ".layers." + lyrJson["id"], official));
|
||||
|
||||
this.extraLink = new ExtraLinkConfig(json.extraLink ?? {
|
||||
icon: "./assets/svg/pop-out.svg",
|
||||
href: "https://mapcomplete.osm.be/{theme}.html?lat={lat}&lon={lon}&z={zoom}&language={language}",
|
||||
newTab: true,
|
||||
requirements: ["iframe","no-welcome-message"]
|
||||
}, context)
|
||||
|
||||
|
||||
this.clustering = {
|
||||
maxZoom: 16,
|
||||
|
@ -148,7 +156,6 @@ export default class LayoutConfig {
|
|||
this.enableShowAllQuestions = json.enableShowAllQuestions ?? false;
|
||||
this.enableExportButton = json.enableDownload ?? false;
|
||||
this.enablePdfDownload = json.enablePdfDownload ?? false;
|
||||
this.enableIframePopout = json.enableIframePopout ?? true
|
||||
this.customCss = json.customCss;
|
||||
this.overpassUrl = Constants.defaultOverpassUrls
|
||||
if (json.overpassUrl !== undefined) {
|
||||
|
|
81
UI/BigComponents/ExtraLinkButton.ts
Normal file
81
UI/BigComponents/ExtraLinkButton.ts
Normal file
|
@ -0,0 +1,81 @@
|
|||
import {UIElement} from "../UIElement";
|
||||
import BaseUIElement from "../BaseUIElement";
|
||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
import ExtraLinkConfig from "../../Models/ThemeConfig/ExtraLinkConfig";
|
||||
import MapControlButton from "../MapControlButton";
|
||||
import Link from "../Base/Link";
|
||||
import Img from "../Base/Img";
|
||||
import {SubtleButton} from "../Base/SubtleButton";
|
||||
import Toggle from "../Input/Toggle";
|
||||
import Loc from "../../Models/Loc";
|
||||
import Locale from "../i18n/Locale";
|
||||
import {Utils} from "../../Utils";
|
||||
|
||||
export default class ExtraLinkButton extends UIElement{
|
||||
private readonly _config: ExtraLinkConfig;
|
||||
private readonly state: {
|
||||
layoutToUse: {id: string};
|
||||
featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>};
|
||||
|
||||
constructor(state: {featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>, layoutToUse: {id: string}},
|
||||
config: ExtraLinkConfig) {
|
||||
super();
|
||||
this.state = state;
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
protected InnerRender(): BaseUIElement {
|
||||
if(this._config === undefined){
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const c = this._config;
|
||||
|
||||
const isIframe = window !== window.top
|
||||
|
||||
if(c.requirements.has("iframe") && !isIframe){
|
||||
return undefined
|
||||
}
|
||||
|
||||
if(c.requirements.has("no-iframe") && isIframe){
|
||||
return undefined
|
||||
}
|
||||
|
||||
let link : BaseUIElement
|
||||
const theme = this.state.layoutToUse?.id ?? ""
|
||||
const href = this.state.locationControl.map(loc => {
|
||||
const subs = {
|
||||
...loc,
|
||||
theme: theme,
|
||||
language: Locale.language.data
|
||||
}
|
||||
return Utils.SubstituteKeys(c.href, subs)
|
||||
})
|
||||
|
||||
if(c.text === undefined){
|
||||
link = new MapControlButton(
|
||||
new Link(new Img(c.icon), href, c.newTab).SetClass("block w-full h-full p-1.5")
|
||||
)
|
||||
}else {
|
||||
let img : BaseUIElement = undefined
|
||||
if(c.icon !== undefined){
|
||||
img = new Img(c.icon).SetClass("h-6")
|
||||
}
|
||||
|
||||
link = new SubtleButton(img,c.text, {url:
|
||||
href,
|
||||
newTab: c.newTab}).SetClass("w-64 block")
|
||||
}
|
||||
|
||||
if(c.requirements.has("no-welcome-message")){
|
||||
link = new Toggle(undefined, link, this.state.featureSwitchWelcomeMessage)
|
||||
}
|
||||
|
||||
if(c.requirements.has("welcome-message")){
|
||||
link = new Toggle(link, undefined, this.state.featureSwitchWelcomeMessage)
|
||||
}
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
}
|
|
@ -8,9 +8,7 @@ import Svg from "../Svg";
|
|||
import Toggle from "./Input/Toggle";
|
||||
import UserBadge from "./BigComponents/UserBadge";
|
||||
import SearchAndGo from "./BigComponents/SearchAndGo";
|
||||
import Link from "./Base/Link";
|
||||
import BaseUIElement from "./BaseUIElement";
|
||||
import {VariableUiElement} from "./Base/VariableUIElement";
|
||||
import LeftControls from "./BigComponents/LeftControls";
|
||||
import RightControls from "./BigComponents/RightControls";
|
||||
import CenterMessageBox from "./CenterMessageBox";
|
||||
|
@ -19,7 +17,6 @@ import ScrollableFullScreen from "./Base/ScrollableFullScreen";
|
|||
import Translations from "./i18n/Translations";
|
||||
import SimpleAddUI from "./BigComponents/SimpleAddUI";
|
||||
import StrayClickHandler from "../Logic/Actors/StrayClickHandler";
|
||||
import Lazy from "./Base/Lazy";
|
||||
import {DefaultGuiState} from "./DefaultGuiState";
|
||||
import LayerConfig from "../Models/ThemeConfig/LayerConfig";
|
||||
import * as home_location_json from "../assets/layers/home_location/home_location.json";
|
||||
|
@ -27,6 +24,7 @@ import NewNoteUi from "./Popup/NewNoteUi";
|
|||
import Combine from "./Base/Combine";
|
||||
import AddNewMarker from "./BigComponents/AddNewMarker";
|
||||
import FilteredLayer from "../Models/FilteredLayer";
|
||||
import ExtraLinkButton from "./BigComponents/ExtraLinkButton";
|
||||
|
||||
|
||||
/**
|
||||
|
@ -169,23 +167,17 @@ export default class DefaultGUI {
|
|||
() => new SearchAndGo(state))
|
||||
.AttachTo("searchbox");
|
||||
|
||||
|
||||
let iframePopout: () => BaseUIElement = undefined;
|
||||
|
||||
if (window !== window.top) {
|
||||
// MapComplete is running in an iframe
|
||||
iframePopout = () => new VariableUiElement(state.locationControl.map(loc => {
|
||||
const url = `${window.location.origin}${window.location.pathname}?z=${loc.zoom ?? 0}&lat=${loc.lat ?? 0}&lon=${loc.lon ?? 0}`;
|
||||
const link = new Link(Svg.pop_out_img, url, true).SetClass("block w-full h-full p-1.5")
|
||||
return new MapControlButton(link)
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
new Toggle(new Lazy(() => self.InitWelcomeMessage()),
|
||||
Toggle.If(state.featureSwitchIframePopoutEnabled, iframePopout),
|
||||
state.featureSwitchWelcomeMessage
|
||||
).AttachTo("messagesbox");
|
||||
new Combine([
|
||||
Toggle.If(state.featureSwitchExtraLinkEnabled,
|
||||
() => new ExtraLinkButton(state, state.layoutToUse.extraLink).SetClass("pointer-events-auto")
|
||||
)
|
||||
,
|
||||
Toggle.If(
|
||||
state.featureSwitchWelcomeMessage,
|
||||
() => self.InitWelcomeMessage()
|
||||
)])
|
||||
.SetClass("flex flex-col")
|
||||
.AttachTo("messagesbox");
|
||||
|
||||
|
||||
new LeftControls(state, guiState).AttachTo("bottom-left");
|
||||
|
|
|
@ -4929,7 +4929,7 @@
|
|||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/default"
|
||||
"$ref": "#/definitions/default_1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -5038,7 +5038,7 @@
|
|||
],
|
||||
"type": [
|
||||
{
|
||||
"$ref": "#/definitions/default_2"
|
||||
"$ref": "#/definitions/default_3"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
|
@ -5268,6 +5268,78 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableUserBadge"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableShareScreen"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableMoreQuests"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableLayers"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableSearch"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableAddNewPoints"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableGeolocation"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableBackgroundLayerSelection"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableShowAllQuestions"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableDownload"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enablePdfDownload"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"enableNoteImports"
|
||||
],
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"path": [
|
||||
"overpassUrl"
|
||||
|
|
|
@ -19,6 +19,17 @@
|
|||
"descriptionTail": {
|
||||
"nl": "<p>Een initiatief van de 5 provinciale toeristische organisaties en Toerisme Vlaanderen</p><p><a href='https://www.toerismevlaanderen.be/pinjepunt'>Meer informatie op toerismevlaanderen.be</a></p><img style='height:5rem; width: auto; margin-top: 1.25rem; margin-bottom: 0.5rem; margin-left: 1.5rem;' src='./assets/themes/toerisme_vlaanderen/logo.png' />"
|
||||
},
|
||||
"extraLink": {
|
||||
"icon": "./assets/svg/pop-out.svg",
|
||||
"href": "https://mapcomplete.osm.be/{theme}.html?lat={lat}&lon={lon}&z={zoom}&language={language}",
|
||||
"newTab": true,
|
||||
"requirements": [
|
||||
"iframe"
|
||||
],
|
||||
"text": {
|
||||
"nl": "Open in volledig scherm"
|
||||
}
|
||||
},
|
||||
"icon": "./assets/themes/toerisme_vlaanderen/logo.svg",
|
||||
"startZoom": 8,
|
||||
"startLat": 50.8536,
|
||||
|
|
|
@ -1052,6 +1052,10 @@ video {
|
|||
height: 2.75rem;
|
||||
}
|
||||
|
||||
.h-6 {
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.h-32 {
|
||||
height: 8rem;
|
||||
}
|
||||
|
@ -1060,10 +1064,6 @@ video {
|
|||
height: 4rem;
|
||||
}
|
||||
|
||||
.h-6 {
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.h-4 {
|
||||
height: 1rem;
|
||||
}
|
||||
|
@ -1148,6 +1148,10 @@ video {
|
|||
width: 2.75rem;
|
||||
}
|
||||
|
||||
.w-64 {
|
||||
width: 16rem;
|
||||
}
|
||||
|
||||
.w-4 {
|
||||
width: 1rem;
|
||||
}
|
||||
|
@ -1501,10 +1505,6 @@ video {
|
|||
padding: 1rem;
|
||||
}
|
||||
|
||||
.p-1\.5 {
|
||||
padding: 0.375rem;
|
||||
}
|
||||
|
||||
.p-1 {
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
@ -1517,6 +1517,10 @@ video {
|
|||
padding: 0px;
|
||||
}
|
||||
|
||||
.p-1\.5 {
|
||||
padding: 0.375rem;
|
||||
}
|
||||
|
||||
.p-0\.5 {
|
||||
padding: 0.125rem;
|
||||
}
|
||||
|
@ -2318,7 +2322,6 @@ li::marker {
|
|||
max-width: calc(100vw - 5em);
|
||||
width: 40em;
|
||||
max-height: calc(100vh - 15em);
|
||||
overflow-y: auto;
|
||||
background-color: var(--background-color);
|
||||
color: var(--foreground-color);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue