From 58bcdbe17ae5a43eeca1fe134a83093fe739b238 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 15 Jul 2020 11:23:35 +0200 Subject: [PATCH] Adding documentation --- Customizations/LayerDefinition.ts | 26 ++++++++++++++++++++++++++ Customizations/Layout.ts | 19 ++++++++++++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Customizations/LayerDefinition.ts b/Customizations/LayerDefinition.ts index 03822e3..14f9b40 100644 --- a/Customizations/LayerDefinition.ts +++ b/Customizations/LayerDefinition.ts @@ -16,9 +16,35 @@ export class LayerDefinition { * This name is shown in the 'add XXX button' */ name: string; + /** + * These tags are added whenever a new point is added by the user on the map. + * This is the ideal place to add extra info, such as "fixme=added by MapComplete, geometry should be checked" + */ newElementTags: Tag[] + /** + * Not really used anymore + * This is meant to serve as icon in the buttons + */ icon: string; + /** + * Only show this layer starting at this zoom level + */ minzoom: number; + + /** + * This tagfilter is used to query overpass. + * Examples are: + * + * new Tag("amenity","drinking_water") + * + * or a query for bicycle pumps which have two tagging schemes: + * new Or([ + * new Tag("service:bicycle:pump","yes") , + * new And([ + * new Tag("amenity","compressed_air"), + * new Tag("bicycle","yes")]) + * ]) + */ overpassFilter: TagsFilter; /** diff --git a/Customizations/Layout.ts b/Customizations/Layout.ts index 7a5b880..7c72927 100644 --- a/Customizations/Layout.ts +++ b/Customizations/Layout.ts @@ -17,7 +17,20 @@ export class Layout { public welcomeTail: string; public locationContains: string[]; - + + /** + * + * @param name: The name used in the query string. If in the query "quests=" is defined, it will select this layout + * @param title: Will be used in the of the page + * @param layers: The layers to show, a list of LayerDefinitions + * @param startzoom: The initial starting zoom of the map + * @param startLat:The initial starting latitude of the map + * @param startLon: the initial starting longitude of the map + * @param welcomeMessage: This message is shown in the collapsable box on the left + * @param gettingStartedPlzLogin: This is shown below the welcomemessage and wrapped in a login link. + * @param welcomeBackMessage: This is shown when the user is logged in + * @param welcomeTail: This text is shown below the login message. It is ideal for extra help + */ constructor( name: string, title: string, @@ -26,8 +39,8 @@ export class Layout { startLat: number, startLon: number, welcomeMessage: string, - gettingStartedPlzLogin: string, - welcomeBackMessage: string, + gettingStartedPlzLogin: string = "Please login to get started", + welcomeBackMessage: string = "You are logged in. Welcome back!", welcomeTail: string = "" ) { this.title = title;