Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: multi choice checkbox #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions content/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ type | format | required | readonly | maxLength | constraint | Description
`text` | string | supported | supported | supported || Text input
`textarea` | string | supported | supported | supported || Text input with resizable box
`dropdown` | string || supported || supported | Dropdown based on options values
`checkbox` | boolean or configured values || supported ||| Checkbox, defaults to not checked.
`checkbox` | boolean, array or configured values || supported ||| Checkbox single or multiple choice, defaults to single and not checked.
`image` | base64 || supported ||| Uploads image
`color` | hexadecimal || supported ||| Activates a color-picker
`time` | hh:mm:ss | supported | supported ||| Defaults to current time. Use defaultTime:false to not.
Expand Down Expand Up @@ -890,6 +890,7 @@ Property | Description | Required | Default value
`valueQueryParameter`| When using `useBackingValue` in combination with `dynamic` the GET parameter name that is used for reverse lookup can be set using this parameter | No | "value"

**defaultValue object**

The defaultValue object controls how an attribute's default value is handled. Default values are always set when creating new features, and can optionally be set when updating attributes.
Default values can be overridden in the attribute editor unless attribute is configured as readonly or hidden.

Expand All @@ -901,8 +902,8 @@ Property | Description | Required | Default value
`timeStampFormat`| One of `time` = "HH:mm:ss", `date`= "yyyy-MM-dd", `datetime` = "yyyy-MM-dd HH:mm:ss", `timestamp` = "yyyy-MM-ddTHH:mm:ss | No | `timestamp`
`useUTC` | `true`if time should be in UTC, otherwise local time | No | `false`


**checkbox Config object**

An object that defines additional configuration for checkbox. The entire object is optional and all
properties are set to default if omitted.

Expand All @@ -911,6 +912,12 @@ Property | Description | Required | Default value
`uncheckedValue` | Value that corresponds to the unchecked state | No | 0 (false)
`checkedValue` | Value that corresponds to the checked state | No | 1 (true)

**checkbox Options array**

For the checkbox attribute type an array can be supplied used to set up multiple choice type checkbox questions.
The array contains the strings that should be able to select between.
By adding to the string the suffix `:textbox`, a textbox is attached to the option, the text box is enabled only if the option is checked. This can be used as an "other"/"miscellaneous" free text option.

#### Example editor attributes

```json
Expand All @@ -931,6 +938,17 @@ Property | Description | Required | Default value
"uncheckedValue": "false"
}
},
{
"name": "multiChoice",
"title": "Please select all that applies: ",
"type": "checkbox",
"options": [
"choice 1",
"choice 2",
"choice 3",
"choice other:textbox"
]
},
{
"name": "category",
"title": "category: ",
Expand Down Expand Up @@ -1323,4 +1341,4 @@ WMS servers can usually serve getFeatureInfo requests with a text/html reply. So

It is advisable to check the default function in src/getfeatureinfo.js to see the form of what is to be returned depending on whether a `htmlSeparator` prop is provided.

Note that the `source` of the [WMS](#wms) layer must have the `type` prop with the `geoserver` value for the `text/html` value of the `infoFormat` property to have the proper effect.
Note that the `source` of the [WMS](#wms) layer must have the `type` prop with the `geoserver` value for the `text/html` value of the `infoFormat` property to have the proper effect.