Skip to content

Commit 5f53237

Browse files
committed
add use case - image guide
1 parent 551d0a7 commit 5f53237

17 files changed

+69
-1
lines changed

src/.vitepress/sidebar/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export default {
9696
{ text: 'How to Use a Phone Call Link', link: '/layer/phone-call-link/' },
9797
{ text: 'How to Link Multiple Records to One Feature (1-N Relations)', link: '/layer/one-to-n-relations/' },
9898
{ text: 'How to Embed an Image', link: '/layer/embed-image/' },
99+
{ text: 'How to Use Image Guides in the Form', link: '/layer/image-guide/' },
99100
] },
100101
] },
101102
{

src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ The ecosystem consist of various components:
9494
- [How to Use a Phone Call Link ](./layer/phone-call-link/)
9595
- [How to Link Multiple Records to One Feature](./layer/one-to-n-relations/)
9696
- [How to Embed an Image](./layer/embed-image/)
97+
- [How to Use Image Guides in Form](./layer/embed-image/)
9798

9899
## Fieldwork Tips
99100
- [<MobileAppName /> Interface](./field/mobile-app-ui/)

src/layer/image-guide/index.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
description: See how to set up an image guide in the attributes form to display reference pictures while collecting data in the field.
3+
outline: deep
4+
---
5+
6+
# How to Use Image Guides in the Form
7+
8+
When collecting data in the field, it may be useful to have a visual guide as a reference to ensure that correct information is entered in the form. For example, when collecting information about trees, it may help to see a reference photo of the tree trunk to identify the type of tree correctly.
9+
10+
:::tip Example project available
11+
Clone <MerginMapsProject id="documentation/image_guide" /> to explore this setup.
12+
:::
13+
14+
![Mergin Maps mobile app form with image guide](./mobile-image-guide.gif "Mergin Maps mobile app form with image guide")
15+
16+
## Data, layers, and attributes
17+
In this scenario, we want to include a photo guide in the form so that users can compare the type of a tree trunk to a reference picture while collecting data in the field.
18+
19+
The <MainPlatformName /> project contains:
20+
- a survey layer (here: `trunk_type.gpkg`) with the form configured to display or hide the image guide
21+
- a table (here: `list.gpkg`) that is used as a [value relation](../value-select/#value-relation) in the survey layer's attributes form, so that users can choose a tree type from a drop-down menu
22+
- a reference photo for each type of tree, stored in the <MainPlatformName /> project folder and packaged with the project
23+
24+
![Mergin Maps project folder](./project-folder.webp "Mergin Maps project folder")
25+
26+
The survey layer (here: `trunk_type`) has following fields:
27+
- `type` to store a the tree type
28+
- `photos` to store a photo of the surveyed tree
29+
- `display` used to display or hide the image guide
30+
- `date` to store the survey date
31+
- `image_guide_xy` to display the reference image of the specific tree trunk type. There is a separate field for each type.
32+
33+
![Survey layer fields](./qgis-layer-fields.webp "Survey layer fields")
34+
35+
## Attributes form configuration in QGIS
36+
37+
We use the **Drag and Drop Designer** option in the **Attributes Form** tab of **Layer Properties** to configure the form.
38+
39+
The image guide is set up as follows:
40+
- The `display` field uses the [checkbox](../checkbox/) widget with *true* and *false* values.
41+
42+
The alias of the field is set to *Show me photo guide*.
43+
44+
![Checkbox widget used to display image guide](./qgis-form-checkbox.webp "Checkbox widget used to display image guide")
45+
46+
- The [tab](../tabs-and-groups/) named `Photo guide` is used to group all `image_guide_xy` fields.
47+
48+
The tab uses [conditional visibility](../conditional-visibility/) so that the image guide is displayed only when `display = 'true'`
49+
50+
![Attributes form conditional visibility](./qgis-form-conditional-visibility.webp "Attributes form conditional visibility")
51+
52+
- The photo guide fields `image_guide_xy` use the [Attachment](../photos/#photo-attachment-widget-in-qgis) widget with *Relative* paths.
53+
54+
The [Integrated Document Viewer](../photos/#displaying-photos-in-qgis) is set to *Image* to display the picture in the form.
55+
56+
The [default values](../default-values/) contain the name of the reference picture (such as `scots_pine.png`). This ensures that the image guide is present when a new feature is created.
57+
58+
![Image guide items setup - Attachment widget](./qgis-form-image-guide-items.webp "Image guide items setup - Attachment widget")
59+
60+
## Image guide in the mobile app
61+
62+
When the form is opened in the <MobileAppNameShort />, the image guide can be easily displayed and hidden by toggling the **Show me photo guide** checkbox.
63+
64+
![Mergin Maps mobile app form image guide](./mobile-form-image-guide.webp "Mergin Maps mobile app form image guide")
559 KB
Loading
4.05 MB
Binary file not shown.
1.61 MB
Loading
308 KB
Loading
737 KB
Binary file not shown.
50.1 KB
Loading
532 KB
Binary file not shown.

0 commit comments

Comments
 (0)