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/embed-image/index.md
+39-5Lines changed: 39 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,47 @@
1
1
---
2
-
description: HTML widget can be used to embed an online image in the attributes form of your survey layer.
2
+
description: Preview online images in the attributes form of your survey layer using the Attachment or HTML widgets.
3
3
---
4
4
5
5
# How to Embed an Image
6
+
Online images can be displayed in the attributes form of a survey layer. There are two options:
7
+
-[Using the Attachment widget](#using-the-attachment-widget) is a straight-forward option to preview an online image in the form. Tapping the image in the form in the <MobileAppNameShort /> opens the image, so you can explore it in more detail directly in the app.
8
+
-[The HTML widget](#using-the-html-widget) uses a link stored in a field to display the image. Tapping the image in the form in the <MobileAppNameShort /> opens the image in a web browser (outside of the app).
6
9
7
-
The [**HTML widget**](../info-widgets/#html-widget) can be used to display online images in the <MobileAppNameShort />.
10
+

8
11
9
12
::: tip Example project available
10
-
Clone <MerginMapsProjectid="documentation/forms-display-images-and-files" /> to how this works.
13
+
Both options are included in our example project <MerginMapsProjectid="documentation/forms-display-images-and-files" />. Clone it to see how they work.
14
+
:::
15
+
16
+
## Using the attachment widget
17
+
The attachment widget can be configured to display online images in the form of a survey layer.
18
+
19
+
The survey layer needs to have a text field for storing the full URL link (here: `photo`).
20
+
21
+
1. Right-click on the survey layer, select **Properties** and go to the **Attributes form** tab.
22
+
2. In the list of **Available Widgets** select the text field you want to work with (here: `photo`).
23
+
3. In the **Widget Type** tab:
24
+
- From the drop-down menu, select the **Attachment** widget
25
+
- Store the path as **Absolute path**
26
+
- Set the **Integrated Document Viewer** to use the type **Web View**
27
+
28
+

29
+
30
+
4.**Apply** the changes
31
+
32
+
Online images can now be displayed in the form, both in QGIS (left) and in <MobileAppName /> (right):
33
+

34
+
35
+
When you click or tap on the image, it will open directly in the form and you can zoom in.
36
+
37
+
::: details Image preview in QGIS
38
+
Some QGIS versions may not display the preview of the image correctly. This issue does not occur in <MobileAppNameShort />. Therefore we recommend trying the setup by opening the form in the <MobileAppNameShort /> to make sure it works as intended.
11
39
:::
12
40
41
+
## Using the HTML widget <Badgetext="Advanced"type="warning"/>
42
+
43
+
The [**HTML widget**](../info-widgets/#html-widget) can be used to display online images in the <MobileAppNameShort />.
44
+
13
45
Your layer should contain a text field for storing the full URL link (here: `link`).
14
46
15
47
To show an online image in the form, [add the HTML widget to the form](../info-widgets/) and configure it with this expression (replace `link` with the name of the appropriate field in your layer):
@@ -18,9 +50,11 @@ To show an online image in the form, [add the HTML widget to the form](../info-w
Make sure that the HTML widget works before taking it to the field by testing it in the <MobileAppNameShort />. It should look something like this:
53
+
Make sure that the HTML widget works before taking it to the field by testing it in the <MobileAppNameShort />. It should display the online image both in QGIS (left) and in the <MobileAppNameShort /> (right):
54
+
55
+

22
56
23
-

57
+
When you click or tap on the image, it will open in a web browser.
24
58
25
59
::: details Image preview in QGIS
26
60
Some QGIS versions may not display the preview of the image correctly. This issue does not occur in <MobileAppNameShort />. Therefore we recommend trying the setup by opening the form in the <MobileAppNameShort /> to make sure it works as intended.
Copy file name to clipboardExpand all lines: src/layer/form-layout/index.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,15 @@ QGIS Drag and Drop designer is an easy tool for defining the form layouts:
27
27
<Badgetext="since QGIS 3.30"type="tip"/>
28
28
The Spacer widget can be useful if you want to have some space between the fields in your form or add a horizontal line.
29
29
30
+
::: tip Example project available
31
+
The spacer widget is used in <MerginMapsProjectid="documentation/forms-display-images-and-files" />.
32
+
:::
33
+
30
34
It can be found in *Available Widgets* in the *Other Widgets* section when using the [Drag and Drop Designer](#qgis-drag-and-drop-designer).
31
35

32
36
33
37
When adding the spacer widget to the form, there is an option to check the **Draw horizontal line** option. Otherwise, a vertical space will be added to the form.
0 commit comments