You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/layer/info-widgets/index.md
+4-76Lines changed: 4 additions & 76 deletions
Original file line number
Diff line number
Diff line change
@@ -1,78 +1,6 @@
1
-
# Attributes Form Layout
1
+
# Informational Widgets
2
2
[[toc]]
3
3
4
-
Collecting and editing data in the field can be more efficient with forms that are easy to navigate. QGIS offers a lot of options for improving the layout of your forms, such as using groups and tabs to keep related fields together, displaying or hiding a group of fields based on conditional visibility, or displaying tips and instructions in the forms.
5
-
6
-
7
-
## QGIS Drag and Drop Designer
8
-
By default, the form is automatically generated and contains all the fields in the layer. However, you might want to change the order of the fields. Also, there may be some fields that do not need to be displayed during the survey, such as fields with [default values](../form-configuration/#default-values) that are calculated from the geometry.
9
-
10
-
QGIS Drag and Drop designer is an easy tool for defining the form layouts:
11
-
1. Open your <MainPlatformNameLink /> project in QGIS
12
-
2. Right-click on a layer and select **Properties**
13
-
3. Navigate to the **Attributes form** tab. Here, switch to **Drag and Drop Designer**
14
-
4. Fields can be added and removed from the **Form Layout**. The order of the fields can be changed by simply dragging them higher or lower in the list.
15
-
16
-
Only fields that are in the **Form layout** will appear in the form.
17
-
18
-
5. Click **OK** to confirm your changes.
19
-
20
-

21
-
22
-
## Tabs and groups
23
-
Using QGIS Drag and Drop designer, fields can be arranged into groups and tabs.
24
-
25
-
:::tip Example project available
26
-
To see an example of tabs and groups, you can clone <MerginMapsProjectid="documentation/form_setup" />.
27
-
:::
28
-
29
-
1. Click on the **+** button to add new group or a tab to the form layout
30
-

31
-
2. Choose the container type, add a label, and if needed, the number of columns.
32
-
33
-
A group can be placed within a tab or another group.
34
-

35
-

36
-
37
-
3. Drag and drop fields to tabs or groups as needed.
38
-
39
-
Here we have two tabs, *Data* and *Changelog*. The *Data* tab contains two groups: *roads* and *paths*.
40
-

41
-
42
-
The form with tabs and groups will appear in QGIS like this:
43
-

44
-
45
-
And this is how the same form looks like in the <MobileAppNameShort />:
46
-

47
-
48
-
49
-
## Show and hide fields depending on a field value (conditional visibility)
50
-
Conditional visibility can be applied to groups and tabs, meaning they will be displayed or hidden depending on the value of a field.
51
-
52
-
:::tip Example project available
53
-
You can explore this functionality in <MerginMapsProjectid="documentation/form_setup" />.
54
-
:::
55
-
56
-
Here we will use a line layer named `roads and paths`. It is designed for surveying both roads and paths and most of the fields are relevant for every type of feature in this layer. However, there are some attributes that are specific for roads (e.g. the number of lanes) or for paths (e.g. the visibility of the path).
57
-
58
-
The form uses the value of the `type` field to display the relevant set of attributes. The `type` field is set up as [value map](../form-widgets/#value-map) with defined values `road` and `path`.
59
-
60
-

61
-
62
-
To set the visibility of groups in the attributes form:
63
-
1. Click on the **roads** group in the **Form Layout**
64
-
2. Check the **Control Visibility by Expression** option :heavy_check_mark:
65
-
3. Define the expression. Here we use: `"type" = "road"`
66
-
67
-

68
-
69
-
4. Same steps are used for the **path** group using the expression `"type" = "path"`
70
-
71
-
In the <MobileAppNameShort />, the form displays these groups only when the condition is met. So, there are different sets of attributes depending on the value that is entered in the `type` field.
72
-
73
-

74
-
75
-
76
4
## Display instructions in the form using Text and HTML widget
77
5
Sometimes, you may want to include instructions or tips for surveyors in your forms. <QGISlink=""text="QGIS" /> offers Text and HTML widgets that can be used for this purpose. Your text instructions can include [expressions and field values](#using-expressions-in-text-and-html-widgets) as well. The HTML widget supports various [HTML tags](https://doc.qt.io/qt-6/richtext-html-subset.html#supported-tags), so it can be also used, for instance, to display [online images](#using-html-widget-to-display-online-images-and-other-online-resources).
78
6
@@ -88,7 +16,7 @@ If you prefer your text to be formatted, you may do so in the **HTML** widget. H
88
16
...and this is how the Text and HTML widgets look like in the form in QGIS (left) and in the mobile app (right).
89
17

90
18
91
-
###Using expressions in Text and HTML widgets
19
+
## Using expressions in Text and HTML widgets
92
20
Expressions and variables can be used both in the Text and the HTML widget.
93
21
94
22

@@ -114,7 +42,7 @@ Clone <MerginMapsProject id="documentation/form_cascade" /> to follow this examp
114
42
... and this is how it works during the field survey. `[% "VRP" %]` expression displays the current value of the `Vehicle Registration Plate` field.
115
43

116
44
117
-
###Using HTML widget to display online images and other online resources
45
+
## Using HTML widget to display online images and other online resources
118
46
The **HTML widget** can be also used to display online images in the mobile app or open online resources, such as PDF files, videos or websites, in the browser of your device.
119
47
120
48
::: tip
@@ -145,7 +73,7 @@ QGIS may not display the preview of the online image if you use QGIS 3.36 or hig
145
73
:::
146
74
147
75
148
-
###Using HTML widget to open local files
76
+
## Using HTML widget to open local files
149
77
The HTML widget can also be used to open local files: for instance, a locally stored PDF file can be opened from within the form during the survey.
Copy file name to clipboardExpand all lines: src/layer/photos/index.md
+22-19Lines changed: 22 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
# Capturing Photos
1
+
# Photos
2
2
[[toc]]
3
3
4
4
When surveying, you might want to take a photo from your camera or attach an existing photo from the device gallery to your survey feature.
5
5
6
-
To capture and save photos using the <MobileAppNameShort />, the survey layer needs to have a field configured with the [attachment widget](../form-widgets/#attachment).
6
+
To capture and save photos using the <MobileAppNameShort />, the survey layer needs to have a field configured with the [**Attachment** widget](#photo-attachment-widget-in-qgis) in QGIS.
7
7
8
8
In the <MobileAppNameShort />, this field will provide two options:
9
9
-**Take a picture** to use your camera app for taking a photos
@@ -12,13 +12,13 @@ In the <MobileAppNameShort />, this field will provide two options:
12
12

13
13
14
14
:::tip
15
-
Do you need to attach multiple pictures to one feature? [How to attach multiple photos to features](../attach-multiple-photos-to-features/) will guide you through the setup.
15
+
Do you need to attach multiple pictures to one feature? [How to attach multiple photos to features](#how-to-attach-multiple-photos-to-features) will guide you through the setup.
16
16
:::
17
17
18
18
::: warning
19
19
Keep in mind that synchronising photos during the field survey can use up a lot of mobile data - depending on the amount of pictures taken and their size.
20
20
21
-
To reduce the data usage, you may consider using [selective synchronisation](../../manage/selective_sync/), [resizing pictures automatically](#resizing-pictures-automatically) or following the [offline field survey workflow](../../field/offline-use/#offline-field-survey-workflow).
21
+
To reduce the data usage, you may consider using [selective synchronisation](../../manage/selective_sync/), [resizing pictures automatically](../../gis/features/#photo-quality) or following the [offline field survey workflow](../../field/offline-use/#offline-field-survey-workflow).
22
22
:::
23
23
24
24
## Photo attachment widget in QGIS
@@ -27,7 +27,7 @@ To reduce the data usage, you may consider using [selective synchronisation](../
27
27
Clone <MerginMapsProjectid="documentation/form_setup" /> to follow this example!
28
28
:::
29
29
30
-
In QGIS, the [attachment widget](../form-widgets/#attachment) is used to set up a field to capture photos.
30
+
In QGIS, the **Attachment** widget is used to set up a field to capture photos.
31
31
32
32
To set up the attachment widget:
33
33
1. Right-click on a layer, select **Properties** and go to the **Attributes form** tab.
@@ -39,22 +39,11 @@ To set up the attachment widget:
39
39
4.**Apply** the changes. Don't forget to save and sync your project!
Here is an overview of paths that will be stored in various settings of the attachment widget. `path/to/project` represents the project home folder, where the project file is located.
|`@project_folder`| Relative to project path |`image.jpg`|
49
-
|`@project_folder`| Relative to default path |`image.jpg`|
50
-
|`@project_home + '/photos'`| Relative to project path |`/photos/image.jpg`|
51
-
|`@project_home + '/photos'`| Relative to default path |`image.jpg`|
52
-
53
42
:::danger Avoid using absolute paths
54
43
Using *absolute paths* causes issues when working with your projects on different devices or working in a team: as each device or team member can use different paths, they may be unable to display the attachments.
55
44
:::
56
45
57
-
## How to set up a custom folder for storing photos
46
+
###How to set up a custom folder for storing photos
58
47
It can be useful to set up a custom folder for photos, e.g. if you want to use [selective synchronisation](../../manage/selective_sync/) or if you simply want to have your data organised.
59
48
60
49
To set up a custom folder:
@@ -74,6 +63,20 @@ To set up a custom folder:
74
63
75
64
8.**Apply the changes**. Don't forget to save and sync your project!
76
65
66
+
### Overview of paths for attachment widget
67
+
68
+
Here is an overview of paths that can be stored in various settings of the attachment widget.
|`@project_folder`| Relative to project path |`image.jpg`|
75
+
|`@project_folder`| Relative to default path |`image.jpg`|
76
+
|`@project_home + '/photos'`| Relative to project path |`/photos/image.jpg`|
77
+
|`@project_home + '/photos'`| Relative to default path |`image.jpg`|
78
+
79
+
77
80
## Resizing pictures automatically
78
81
Photos that are captured during the field survey or uploaded using <MobileAppName /> can be automatically resized, e.g. to save up storage space. The quality of the photos can be set up in the [<MainPlatformName /> project properties](../../gis/features/#photo-quality) using <QGISPluginName />.
79
82
@@ -115,7 +118,7 @@ To see this setup in practice, you can download the following project:
115
118
116
119
To link multiple photos to a single feature, we need a **unique field** to link following tables:
117
120
- Survey layer containing spatial information
118
-
- A non-spatial table containing path to the photos (see [how to setup simple photo forms](../photos/))
121
+
- A non-spatial table containing path to the photos (see [How to setup simple photo forms](../photos/))
119
122
120
123
:::danger WARNING
121
124
**Do not use the FID field to link these tables**. FIDs can be changed during synchronisation, which can result in having photos linked to the incorrect feature. You can learn more about synchronisation in [Behind Data Synchronisation](../../manage/synchronisation/).
@@ -128,7 +131,7 @@ To set 1:N relation between these tables correctly:
128
131

129
132
3. Create a new text field in the non-spatial table (here: `photos`) that will be used to store the UUID of features from the survey layer (the foreign key), here: `external-pk`.
130
133
131
-
Now we need to configure a [1-N relation](../one-to-n-relations/):
134
+
Now we need to configure a [1-N relation](../relations/):
132
135
4. From the main menu, select **Project** > **Properties ...**
133
136
5. In the **Relations** tab, select **Add Relation**
134
137

0 commit comments