|
1 | 1 | --- |
2 | 2 | description: Set up map themes for your Mergin Maps project to easily switch between different combinations of layer styles and visibility. |
| 3 | +outline: deep |
3 | 4 | --- |
4 | 5 |
|
5 | 6 | # Map Themes |
6 | 7 | [[toc]] |
7 | 8 |
|
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 />. |
9 | 10 |
|
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 | +::: |
11 | 14 |
|
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 | + |
13 | 16 |
|
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 | +  |
| 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 | + |
| 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 | + |
| 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 | + |
| 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 | +::: |
17 | 81 |
|
18 | | -Here, we created two themes: `OSM` and `Aerial photos` to easily switch between two types of background maps. |
19 | | - |
20 | 82 |
|
21 | 83 | ## Map themes in Mergin Maps mobile app |
22 | 84 | In the <MobileAppNameShort />, tap **More** and select the **Map themes** option. |
23 | 85 |
|
24 | | - |
| 86 | + |
25 | 87 |
|
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. |
27 | 89 |
|
28 | | -Here, we switched from `OSM` to `Aerial photos`. |
| 90 | +Here, we switched from *default* to *satellite*. |
29 | 91 |
|
30 | | - |
| 92 | + |
31 | 93 |
|
32 | 94 | 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. |
0 commit comments