Full code cleanup

This commit is contained in:
Pieter Vander Vennet 2021-11-07 16:34:51 +01:00
parent 8e6ee8c87f
commit bd21212eba
246 changed files with 19418 additions and 11729 deletions

View file

@ -64,14 +64,14 @@ export interface LayerConfigJson {
* NOTE: the previous format was 'overpassTags: AndOrTagConfigJson | string', which is interpreted as a shorthand for source: {osmTags: "key=value"}
* While still supported, this is considered deprecated
*/
source: ({ osmTags: AndOrTagConfigJson | string, overpassScript?: string } |
source: ({ osmTags: AndOrTagConfigJson | string, overpassScript?: string } |
{ osmTags: AndOrTagConfigJson | string, geoJson: string, geoJsonZoomLevel?: number, isOsmCache?: boolean, mercatorCrs?: boolean }) & ({
/**
* The maximum amount of seconds that a tile is allowed to linger in the cache
*/
maxCacheAge?: number
})
/**
*
* A list of extra tags to calculate, specified as "keyToAssignTo=javascript-expression".
@ -93,8 +93,8 @@ export interface LayerConfigJson {
/**
* This tag rendering should either be 'yes' or 'no'. If 'no' is returned, then the feature will be hidden from view.
* This is useful to hide certain features from view.
*
* This is useful to hide certain features from view.
*
* Important: hiding features does not work dynamically, but is only calculated when the data is first renders.
* This implies that it is not possible to hide a feature after a tagging change
*
@ -207,15 +207,13 @@ export interface LayerConfigJson {
* This is mainly create questions for a 'left' and a 'right' side of the road.
* These will be grouped and questions will be asked together
*/
tagRenderings?: (string | {builtin: string, override: any} | TagRenderingConfigJson | {
tagRenderings?: (string | { builtin: string, override: any } | TagRenderingConfigJson | {
rewrite: {
sourceString: string,
into: string[]
}[],
renderings: (string | {builtin: string, override: any} | TagRenderingConfigJson)[]
renderings: (string | { builtin: string, override: any } | TagRenderingConfigJson)[]
}) [],
/**
@ -273,15 +271,15 @@ export interface LayerConfigJson {
/**
* Indicates if a point can be moved and configures the modalities.
*
*
* A feature can be moved by MapComplete if:
*
*
* - It is a point
* - The point is _not_ part of a way or a a relation.
*
*
* Off by default. Can be enabled by setting this flag or by configuring.
*/
allowMove?: boolean | MoveConfigJson
allowMove?: boolean | MoveConfigJson
/**
* IF set, a 'split this road' button is shown

View file

@ -1,4 +1,3 @@
import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
import {LayerConfigJson} from "./LayerConfigJson";
import TilesourceConfigJson from "./TilesourceConfigJson";
@ -15,7 +14,7 @@ import TilesourceConfigJson from "./TilesourceConfigJson";
* General remark: a type (string | any) indicates either a fixed or a translatable string.
*/
export interface LayoutConfigJson {
/**
* The id of this layout.
*
@ -216,7 +215,7 @@ export interface LayoutConfigJson {
*/
maxZoom?: number,
/**
* The number of elements per tile needed to start clustering
* The number of elements per tile needed to start clustering
* If clustering is defined, defaults to 25
*/
minNeededElements?: number

View file

@ -2,9 +2,9 @@ import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
/**
* The LineRenderingConfig gives all details onto how to render a single line of a feature.
*
*
* This can be used if:
*
*
* - The feature is a line
* - The feature is an area
*/
@ -28,9 +28,9 @@ export default interface LineRenderingConfigJson {
dashArray?: string | TagRenderingConfigJson
/**
* The number of pixels this line should be moved.
* The number of pixels this line should be moved.
* Use a positive numbe to move to the right, a negative to move to the left (left/right as defined by the drawing direction of the line).
*
*
* IMPORTANT: MapComplete will already normalize 'key:both:property' and 'key:both' into the corresponding 'key:left' and 'key:right' tagging (same for 'sidewalk=left/right/both' which is rewritten to 'sidewalk:left' and 'sidewalk:right')
* This simplifies programming. Refer to the CalculatedTags.md-documentation for more details
*/

View file

@ -3,9 +3,9 @@ import {AndOrTagConfigJson} from "./TagConfigJson";
/**
* The PointRenderingConfig gives all details onto how to render a single point of a feature.
*
*
* This can be used if:
*
*
* - The feature is a point
* - To render something at the centroid of an area, or at the start, end or projected centroid of a way
*/
@ -16,7 +16,7 @@ export default interface PointRenderingConfigJson {
* Using `location: ["point", "centroid"] will always render centerpoint
*/
location: ("point" | "centroid" | "start" | "end")[]
/**
* The icon for an element.
* Note that this also doubles as the icon for this layer (rendered with the overpass-tags) ánd the icon in the presets.

View file

@ -17,7 +17,7 @@ export interface TagRenderingConfigJson {
* The first tagRendering of a group will always be a sticky element.
*/
group?: string
/**
* Renders this value. Note that "{key}"-parts are substituted by the corresponding values of the element.
* If neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.
@ -89,13 +89,13 @@ export interface TagRenderingConfigJson {
* Allows fixed-tag inputs, shown either as radiobuttons or as checkboxes
*/
mappings?: {
/**
* If this condition is met, then the text under `then` will be shown.
* If no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.
*
*
* For example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}
*
*
* This can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}
*/
if: AndOrTagConfigJson | string,

View file

@ -12,12 +12,11 @@ export default interface UnitConfigJson {
/**
* The possible denominations
*/
applicableUnits:ApplicableUnitJson[]
applicableUnits: ApplicableUnitJson[]
}
export interface ApplicableUnitJson
{
export interface ApplicableUnitJson {
/**
* The canonical value which will be added to the text.
* e.g. "m" for meters
@ -28,8 +27,8 @@ export interface ApplicableUnitJson
* The canonical denomination in the case that the unit is precisely '1'
*/
canonicalDenominationSingular?: string,
/**
* A list of alternative values which can occur in the OSM database - used for parsing.
*/