Skip to content

Commit 4cc192d

Browse files
authored
improve map themes (#739)
* improve map themes * fix pics * fix broken link
1 parent b487053 commit 4cc192d

17 files changed

Lines changed: 74 additions & 12 deletions

src/gis/setup_themes/index.md

Lines changed: 74 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,94 @@
11
---
22
description: Set up map themes for your Mergin Maps project to easily switch between different combinations of layer styles and visibility.
3+
outline: deep
34
---
45

56
# Map Themes
67
[[toc]]
78

8-
In <MobileAppName />, you can use different **map themes**. This is ideal for switching between different background maps (e.g. cartography map and aerial photography), combinations of visible layers or their styles. The map themes should be first set up in QGIS.
9+
In QGIS, you can define different **map themes** for your project to easily switch between different background maps, combinations of visible layers or their styles, and use them in your <MainPlatformName /> project in the <MobileAppNameShort />.
910

10-
## Setting up QGIS map themes
11+
:::tip Example project available
12+
Download or clone our public project <MerginMapsProject id="documentation/map-themes" /> to see how this setup works.
13+
:::
1114

12-
Read how to <QGISHelp ver="latest" link="user_manual/introduction/general_tools.html#configuring-map-themes" text="set up a new map theme" /> in QGIS.
15+
![Mergin Maps mobile app map themes](./mobile-map-themes.gif "Mergin Maps mobile app map themes")
1316

14-
- Open QGIS Desktop with your QGIS Project
15-
- Define the visibility and/or styles of the layers in your project
16-
- In the Layers Panel, click on "Manage Map Themes" (eye-icon) and add a new theme (or replace an existing one)
17+
## Setting up styles and map themes in QGIS
18+
Here, we will define different symbology for survey layers depending on the displayed background map using styles. Then we will set up [map themes](#map-themes-1) so that we can switch between the basic and the satellite background maps along with the corresponding layers' styles.
19+
20+
Note that you can use the [map themes](#map-themes-1) without defining custom styles for layers, simply to switch between different combinations of visible layers.
21+
22+
You can read more about <QGISHelp ver="latest" link="user_manual/introduction/general_tools.html#managing-custom-styles" text="styles" /> and <QGISHelp ver="latest" link="user_manual/introduction/general_tools.html#configuring-map-themes" text="map themes" /> in the QGIS documentation.
23+
24+
### Custom layers style
25+
26+
:::warning Styles store also attributes forms
27+
Note that a style includes more than symbology: the style also stores labels, attributes form, display and other properties of a layer. The complete list can be found in <QGISHelp ver="latest" link="user_manual/introduction/general_tools.html#managing-custom-styles" text="QGIS documentation" />.
28+
29+
This means that you can have different attributes form setup for various styles of the same survey layer. However, this can also mean that there may be discrepancies in input data, say if these forms use different [widgets](../../layer/form-widgets/) or [default values](../../layer/default-values/) for the same fields.
30+
31+
Therefore we recommend setting up styles after configuring the [attributes form](../../layer/overview/).
32+
:::
33+
34+
First, define the symbology (or other properties) for your survey layers. This will be stored as the *default* style that each layer has by default.
35+
36+
Here we have a point layer `Survey` and a polygon layer `Survey_polygons` that use simple symbols with a non-transparent fill so that they are clearly visible on the basic background map.
37+
38+
Now we will define a new style named *satellite* for survey layers:
39+
1. Right-click on a survey layer and select **Styles** > **Add...**
40+
![QGIS Add new layer style](./qgis-layer-add-style.webp "QGIS Add new layer style")
41+
2. Enter the name of the style, here: `satellite`
42+
3. Define the symbology of a feature (or other properties) for the new style.
43+
44+
Here we use a transparent fill so that the outline of a feature is visible on to the satellite background map.
45+
46+
Repeat these steps for each survey layer that should have different styles. One layer can have multiple styles.
47+
48+
Now you can easily switch between the *default* and *satellite* style by right-clicking the survey layer:
49+
![QGIS Add new layer style](./qgis-layer-styles.webp "QGIS Add new layer style")
50+
51+
52+
### Map themes
53+
A map theme records the visibility of layers and their styles.
54+
55+
To define the *default* theme:
56+
1. In the **Layers** panel, make sure that:
57+
- the survey layers are set to the *default* styles (optional)
58+
- the survey layers and the basic background map are displayed (hide the satellite background map or other layers)
59+
2. Use the **Manage map themes** button to **Add Theme...**.
60+
61+
This theme will be named *default*.
62+
63+
![QGIS Map Themes setup](./qgis_map_themes_setup.webp "QGIS Map Themes setup")
64+
65+
For the *satellite* theme:
66+
1. In the **Layers** panel, make sure that:
67+
- the survey layers are set to the *satellite* styles (optional)
68+
- the survey layers and the satellite background map are displayed (hide the basic background map or other layers)
69+
2. Use the **Manage map themes** button to **Add Theme...** and name this theme *satellite*
70+
71+
Themes can be easily switched using the **Manage map themes** button.
72+
![QGIS Map Themes](./qgis_map_themes.webp "QGIS Map Themes")
73+
74+
Don't forget to save and synchronise the project.
75+
76+
:::tip Using themes in QGIS
77+
In QGIS, themes can be renamed, removed or replaced using the **Manage map themes** button.
78+
79+
To modify an existing theme, make the desired changes in the **Layers** panel and use the **Replace theme** option.
80+
:::
1781

18-
Here, we created two themes: `OSM` and `Aerial photos` to easily switch between two types of background maps.
19-
![QGIS Map Themes setup](./qgis_map_themes_setup.jpg "QGIS Map Themes setup")
2082

2183
## Map themes in Mergin Maps mobile app
2284
In the <MobileAppNameShort />, tap **More** and select the **Map themes** option.
2385

24-
![Map themes option in Mergin Maps mobile app](./mobile-app-map-themes-option.jpg "Map themes option in Mergin Maps mobile app")
86+
![Map themes option in Mergin Maps mobile app](./mobile-app-map-themes-option.webp "Map themes option in Mergin Maps mobile app")
2587

26-
Now you will see the list of map themes that are available in your project. To switch the map theme, tap on it.
88+
Now you will see the map themes that are available in your project. To switch the map theme, tap on it.
2789

28-
Here, we switched from `OSM` to `Aerial photos`.
90+
Here, we switched from *default* to *satellite*.
2991

30-
![Mergin Maps mobile app switching map themes](./mobile-app-map-themes-switch.jpg "Mergin Maps mobile app switching map themes")
92+
![Mergin Maps mobile app switching map themes](./mobile-app-map-themes-switch.webp "Mergin Maps mobile app switching map themes")
3193

3294
It may be useful to define a *default* map theme for your project. Then, If you change the visibility of layers through the [**Layers**](../../field/layers/) option in the <MobileAppNameShort /> during the survey, you can use this map theme to get back to the default setup.
-149 KB
Binary file not shown.
112 KB
Loading
-467 KB
Binary file not shown.
-400 KB
Binary file not shown.
132 KB
Loading
-690 KB
Binary file not shown.
1.34 MB
Loading
53 KB
Loading
244 KB
Binary file not shown.

0 commit comments

Comments
 (0)