2021-11-07 17:18:10 +01:00
2021-11-08 02:36:01 +01:00
2021-11-07 17:18:10 +01:00
Available types for text fields
2021-10-29 13:53:00 +02:00
=================================
2021-11-30 22:45:25 +01:00
## Table of contents
2021-10-29 13:53:00 +02:00
2021-11-30 22:50:48 +01:00
1. [Available types for text fields ](#available-types-for-text-fields )
+ [string ](#string )
+ [text ](#text )
+ [date ](#date )
+ [direction ](#direction )
+ [length ](#length )
+ [wikidata ](#wikidata )
+ [int ](#int )
+ [nat ](#nat )
+ [pnat ](#pnat )
+ [float ](#float )
+ [pfloat ](#pfloat )
+ [email ](#email )
+ [url ](#url )
+ [phone ](#phone )
+ [opening_hours ](#opening_hours )
+ [color ](#color )
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
The listed types here trigger a special input element. Use them in `tagrendering.freeform.type` of your tagrendering to activate them
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
### string
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
A basic string
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
### text
2021-05-11 10:14:33 +02:00
2021-07-24 02:42:37 +02:00
2021-11-30 22:50:48 +01:00
A string, but allows input of longer strings more comfortably and supports newlines (a text area)
### date
A date
### direction
A geographical direction, in degrees. 0° is north, 90° is east, ... Will return a value between 0 (incl) and 360 (excl)
### length
A geographical length in meters (rounded at two points). Will give an extra minimap with a measurement tool. Arguments: [ zoomlevel, preferredBackgroundMapType (comma separated) ], e.g. `["21", "map,photo"]
### wikidata
2021-07-24 02:42:37 +02:00
2021-05-11 10:14:33 +02:00
2021-11-07 17:18:10 +01:00
A wikidata identifier, e.g. Q42.
2021-11-08 02:36:01 +01:00
2021-11-07 17:18:10 +01:00
### Helper arguments
2021-10-29 03:42:33 +02:00
2021-11-07 17:18:10 +01:00
2021-10-29 03:42:33 +02:00
name | doc
------ | -----
key | the value of this tag will initialize search (default: name)
2021-11-07 17:18:10 +01:00
options | A JSON-object of type `{ removePrefixes: string[], removePostfixes: string[] }` .
2021-10-29 03:42:33 +02:00
subarg | doc
-------- | -----
removePrefixes | remove these snippets of text from the start of the passed string to search
removePostfixes | remove these snippets of text from the end of the passed string to search
2021-11-07 17:18:10 +01:00
2021-11-08 02:36:01 +01:00
2021-11-07 17:18:10 +01:00
### Example usage
2021-10-29 03:42:33 +02:00
2021-11-07 17:18:10 +01:00
The following is the 'freeform'-part of a layer config which will trigger a search for the wikidata item corresponding with the name of the selected feature. It will also remove '-street', '-square', ... if found at the end of the name
2021-10-29 03:59:28 +02:00
```
"freeform": {
2021-10-29 13:35:33 +02:00
"key": "name:etymology:wikidata",
"type": "wikidata",
"helperArgs": [
"name",
{
"removePostfixes": [
"street",
"boulevard",
"path",
"square",
"plaza",
]
}
]
}
2021-11-30 22:50:48 +01:00
```
### int
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
A number
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
### nat
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
A positive number or zero
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
### pnat
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
A strict positive number
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
### float
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
A decimal
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
### pfloat
2021-05-11 10:14:33 +02:00
2021-11-30 22:50:48 +01:00
A positive decimal (incl zero)
### email
An email adress
### url
A url
### phone
A phone number
### opening_hours
2021-05-11 10:14:33 +02:00
2021-11-07 17:18:10 +01:00
Has extra elements to easily input when a POI is opened.
2021-11-08 02:36:01 +01:00
2021-11-07 17:18:10 +01:00
### Helper arguments
2021-10-29 03:42:33 +02:00
2021-11-07 17:18:10 +01:00
2021-10-29 03:42:33 +02:00
name | doc
------ | -----
2021-11-07 17:18:10 +01:00
options | A JSON-object of type `{ prefix: string, postfix: string }` .
2021-10-29 03:42:33 +02:00
subarg | doc
-------- | -----
prefix | Piece of text that will always be added to the front of the generated opening hours. If the OSM-data does not start with this, it will fail to parse
postfix | Piece of text that will always be added to the end of the generated opening hours
2021-11-07 17:18:10 +01:00
2021-11-08 02:36:01 +01:00
2021-11-07 17:18:10 +01:00
### Example usage
2021-10-29 03:42:33 +02:00
2021-11-07 17:18:10 +01:00
To add a conditional (based on time) access restriction:
2021-10-29 03:42:33 +02:00
```
2021-10-29 03:59:28 +02:00
2021-10-29 13:35:33 +02:00
"freeform": {
"key": "access:conditional",
"type": "opening_hours",
"helperArgs": [
{
"prefix":"no @ (",
"postfix":")"
}
]
}
```
2021-11-30 22:50:48 +01:00
*Don't forget to pass the prefix and postfix in the rendering as well*: `{opening_hours_table(opening_hours,yes @ &LPARENS, &RPARENS )`
### color
2021-05-11 10:14:33 +02:00
2021-11-08 02:36:01 +01:00
Shows a color picker
This document is autogenerated from ValidatedTextField.ts