Mergin Maps

Support Tip: Using HTML to improve your Mergin Maps project

Did you know that you can use HTML in your Mergin Maps project to give users in the field access to information or other documents related to your survey? In this article, we’ll show you a few ways that you can use HTML to improve your survey workflow. You can even use HTML offline to link to other files stored in the project folder. Keep reading to learn more!

Navigate to points with Google Maps

One of the best uses of HTML in your Mergin Maps project is to use it to create a link in the project form that, when clicked, will open the location of the point Google Maps. The user can then choose to use the ‘Navigate’ feature in Google Maps to find directions to the point. This can be useful if users are trying to navigate to different survey points that are far apart, or help them get to the survey site. 

To create the Google Maps link in your form:

1. Open the layer properties for the layer containing the points the users are navigating to.

2. Go to the ‘Manage Fields’ tab and click on the Field Calculator button.

3. Select the ‘Create a new field’ and ‘Create virtual field’ options.

4. Give the field a name and set the ‘Output field type’ setting to ‘Text (string)’

5. Put the following HTML script in the expression box and replace the highlighted EPSG values with your project CRS:

'<a href="'||'https://www.google.co.uk/maps/place/' || to_string( y(transform( $geometry, 'EPSG:27700', 'EPSG:4326'))) || ',' || to_string( x( transform( $geometry, 'EPSG:27700', 'EPSG:4326'))) || '">Open Google Map</a>'

6. Click ‘OK’

7. Go to the Form Builder tab and place the virtual field in the form layout

8. Use the following options for the field widget:

  1. Set the widget type to Text Edit
  2. Disable editing
  3. Enable Multiline text and HTML
  4. Click ‘OK’ on the layer properties and then save and synchronise your project

Now, when users open the feature on the survey form, they will see a link with ‘Open Google Map’ that they can click and it will open Google Maps on their device, or open it in the browser if they do not have Google Maps installed, and they can then use that link to navigate to the location.

Provide more information to surveyors

Sometimes you might have surveyors in the field who need to identify certain feature types such as plants, geological formations or animal species. It may be helpful to the surveyors if they can access additional information to help provide context about what they are surveying. 

In this example of a bird habitat survey, we’ll show you how to provide the surveyor with a link to more information about a species of bird based on which species they’ve selected from a list. The link will change as the surveyor changes the selection without having to save the entry. This will let them look at the information to confirm their selection before hitting the ‘Save’ button and help reduce errors in the survey.

Prepare the data

First, we need to make sure we have the data set up in our survey so the link feature will work. We’ll need a lookup table with the bird species that will be in the survey, along with a link to more info about each species. In our example, we have a simple CSV table with the following fields:

  • id: an integer field with an ID number for each row
  • species: a text field with the common name of each bird species
  • link: a field with a link to a page on the RSPB website about the species

Here is an example of the table data:

In our survey layer, we have a corresponding species text field that has the following setup:

  • Widget Type: Value Relation
  • Layer: species (this is our lookup table layer)
  • Key column: name
  • Value column: name

Set up the virtual field

Now that we have our layer tables set up, we will create a virtual field on the survey layer for the external link. Follow the exact same steps to create the virtual field as in the previous example, but give this field a different name and use the following expression to create the field:

'<a href="'||attribute(get_feature('species','name',"species"),'link')||'">Species Information</a>'

Now you just need to add the virtual field to your form layout and the user will be able to click on the ‘Species Information’ link in the form to see more information about the species currently selected. 

Open documents stored in the project folder

You can also use HTML to open PDF or other documents that are stored in the project folder. This can also work without a data connection since the files are stored in the project directory and will then be downloaded to the user’s device. To link to any file in the project directory, you can use relative links as a default value for a text field with HTML enabled using the following expression: 

project://<path_to_file_within_project>

Let’s use our previous example of the bird survey so the surveyors can access the bird information when working offline.

To set up the documents in the project:

1. Create a folder in the project directory for the PDFs, we’ll use ‘/species’ in our example project.

2. Make sure the names of the PDF files match the entries in the ‘name’ column of the species lookup table.

3. Set up a virtual field using the same settings as before, using the name ‘offline_id’ and the following expression:

'<a href="'||'project://species/' || "species" || '.pdf">Offline Info</a>'

4. Add the ‘offline_id’ virtual field to the form layout

Now the user can access the offline data stored in the project by clicking the ‘Offline Info’ link and it will open the corresponding PDF.

Keep learning

If you’ve found this tutorial helpful, you can also head over to our documentation to find out about other uses of HTML in your survey project such as customising the preview panel and providing instructions or hints to users in the field. Thank you for using Mergin Maps and be sure to keep an eye out for future articles with tips and best practices. 

You might also like

Mergin Maps

Photo sketching is now available in Mergin Maps

October 28, 2025

Mergin Maps

Best Practices for User Management in Mergin Maps

October 10, 2025

QGIS

Create professional survey reports using QGIS Print Layout after field data collection

September 15, 2025

QGIS

5 Essential QGIS Plugins for GIS Professionals

August 13, 2025

Mergin Maps

Mergin Maps gets sketchy

July 31, 2025

partners

Camptocamp becomes first official Mergin Maps reseller

June 6, 2025

Mergin Maps

New API tools give you more user management options!

May 30, 2025

Mergin Maps

How to Conduct a Field Survey Using QGIS and Mergin Maps: A Complete Step-by-Step Guide

April 16, 2025

plugin

Great Scott! Mergin Maps Plugin has a time machine

March 19, 2025

Mergin Maps

Unlocking premium features of Mergin Maps for all

January 15, 2025

Mergin Maps

2024 - Year in review

December 20, 2024

Mergin Maps

Support tip: What to do if your project is too big

November 29, 2024

Mergin Maps

Mergin Maps now measures in taps

October 24, 2024

Mergin Maps

Announcing the first ever book about Mergin Maps from Locate Press

September 20, 2024

mobile

Support tip - How to make recording lines and polygons simple

August 30, 2024

Mergin Maps

5 best field data collection apps

July 17, 2024

Mergin Maps

Introducing Editor permissions - our most-requested feature!

June 20, 2024

Mergin Maps

We hope you’re enjoying the new experience!

May 31, 2024

QGIS

Support tip: Add SVG symbols to your QGIS project

May 2, 2024

Mergin Maps

Mergin Maps app is getting a fresh new look

March 28, 2024

Mergin Maps

QField vs. Mergin Maps - App Comparison

March 1, 2024

Mergin Maps

Hello from Mergin Maps!

February 13, 2024

plugin

Support tip: Downloading a previous version of your project

January 31, 2024

Mergin Maps

Mergin Maps 2023: our year in review

December 28, 2023

mobile

Mergin Maps is now faster and more stable than ever

November 15, 2023

plugin

Download tiles for offline background maps in five steps

October 30, 2023

partners

We've partnered with MarXact for high-precision surveying in Mergin Maps

October 27, 2023

event

Come see us at INTERGEO 2023 in Berlin

September 29, 2023

Mergin Maps

Mergin Maps Gets a Brand Refresh

September 27, 2023

Mergin Maps

We’ve added the ability to customise photo names in Mergin Maps!

August 31, 2023

mobile

You asked for it and we delivered… Position tracking in Mergin Maps!

August 22, 2023

Mergin Maps

Features wishlist - Help us help you!

July 27, 2023

Mergin Maps

Check out the Mergin Maps interview on App of the Day

May 4, 2023

event

Mergin Maps hope to see you at GeoBusiness London 2023

May 2, 2023

Mergin Maps

Worried about using open-source geospatial software for your business? Mergin Maps support is here for you!

April 28, 2023

Mergin Maps

Camptocamp partners with Mergin Maps to deliver open source GIS solutions

April 25, 2023

Mergin Maps

Subscription tiers are going to change

April 18, 2023

Mergin Maps

Mergin Maps Community and Enterprise Editions

March 31, 2023

Mergin Maps

Introducing Workspaces: Simplified Collaboration

January 31, 2023

Mergin Maps

Mergin Maps: a year in review (2022)

December 20, 2022

Mergin Maps

Mergin Maps in MapScaping podcast

December 15, 2022

plugin

View and track changes in QGIS

December 14, 2022

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Cookie Policy for more information. Deny cookies here.