From 454f30cf3bf0bbb036d527a5d3d606b3a2228047 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Tue, 6 Apr 2021 18:34:45 +0200 Subject: [PATCH] Add docs on URL-parameters --- Docs/URL_Parameters.md | 108 +++++++++++++++++++++++++++++++++++ Logic/Web/QueryParameters.ts | 12 +++- Models/Constants.ts | 2 +- 3 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 Docs/URL_Parameters.md diff --git a/Docs/URL_Parameters.md b/Docs/URL_Parameters.md new file mode 100644 index 0000000..4952640 --- /dev/null +++ b/Docs/URL_Parameters.md @@ -0,0 +1,108 @@ +custom-css +------------ +If specified, the custom css from the given link will be loaded additionaly + +test +------ +If true, 'dryrun' mode is activated. The app will behave as normal, except that changes to OSM will be printed onto the console instead of actually uploaded to osm.org +The default value is _false_ + +layout +-------- +The layout to load into MapComplete + +userlayout +------------ + +The default value is _false_ + +layer-control-toggle +---------------------- +Whether or not the layer control is shown +The default value is _false_ + +tab +----- +The tab that is shown in the welcome-message. 0 = the explanation of the theme,1 = OSM-credits, 2 = sharescreen, 3 = more themes, 4 = about mapcomplete (user must be logged in and have >50 changesets) +The default value is _0_ + +z +--- +The initial/current zoom level +The default value is set by the loaded theme + +lat +----- +The initial/current latitude +The default value is set by the loaded theme + +lon +----- +The initial/current longitude of the app +The default value is set by the loaded theme + +fs-userbadge +-------------- +Disables/Enables the user information pill (userbadge) at the top left. Disabling this disables logging in and thus disables editing all together, effectively putting MapComplete into read-only mode. +The default value is _true_ + +fs-search +----------- +Disables/Enables the search bar +The default value is _true_ + +fs-layers +----------- +Disables/Enables the layer control +The default value is _true_ + +fs-add-new +------------ +Disables/Enables the 'add new feature'-popup. (A theme without presets might not have it in the first place) +The default value is _true_ + +fs-welcome-message +-------------------- +Disables/enables the help menu or welcome message +The default value is _true_ + +fs-iframe +----------- +Disables/Enables the iframe-popup +The default value is _false_ + +fs-more-quests +---------------- +Disables/Enables the 'More Quests'-tab in the welcome message +The default value is _true_ + +fs-share-screen +----------------- +Disables/Enables the 'Share-screen'-tab in the welcome message +The default value is _true_ + +fs-geolocation +---------------- +Disables/Enables the geolocation button +The default value is _true_ + +debug +------- +If true, shows some extra debugging help such as all the available tags on every object +The default value is _false_ + +oauth_token +------------- +Used to complete the login +No default value set + +background +------------ +The id of the background layer to start with +The default value is set by the loaded theme + +layer- +----------------- +Wether or not layer with __ is shown +The default value is _true_ + diff --git a/Logic/Web/QueryParameters.ts b/Logic/Web/QueryParameters.ts index 406afa2..b1adfcd 100644 --- a/Logic/Web/QueryParameters.ts +++ b/Logic/Web/QueryParameters.ts @@ -38,6 +38,10 @@ export class QueryParameters { QueryParameters.knownSources[key] = source; } } + + window["mapcomplete_query_parameter_overview"] = () => { + console.log(QueryParameters.GenerateQueryParameterDocs()) + } } private static Serialize() { @@ -84,7 +88,13 @@ export class QueryParameters { public static GenerateQueryParameterDocs(): string { const docs = []; for (const key in QueryParameters.documentation) { - docs.push("**" + key + "**: " + QueryParameters.documentation[key] + " (default value: _" + QueryParameters.defaults[key] + "_)") + docs.push([ + " "+key+" ", + "-".repeat(key.length + 2), + QueryParameters.documentation[key], + QueryParameters.defaults[key] === undefined ? "No default value set" : `The default value is _${QueryParameters.defaults[key]}_` + + ].join("\n")) } return docs.join("\n\n"); } diff --git a/Models/Constants.ts b/Models/Constants.ts index e7a8c2b..01627fb 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.6.5d"; + public static vNumber = "0.6.6-rc-d"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = {