Skip to content

Commit 51305fb

Browse files
authored
TourGuide Documentation (#28)
* TourGuide Documentation * fix tourguide url
1 parent 88cb558 commit 51305fb

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

qwc2.yml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ nav:
1818
- Editing: topics/Editing.md
1919
- Snapping: topics/Snapping.md
2020
- Temporal layers: topics/TimeManager.md
21+
- Tour Guide: topics/TourGuide.md
2122
- Legend graphics: topics/LegendGraphics.md
2223
- Map filtering: topics/MapFilter.md
2324
- Reports: topics/Reports.md

src/topics/Tourguide.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Tour Guide JSON Configuration
2+
3+
A [DriverJS](https://driverjs.com/) implementation is available in QWC. To configure and use it with the [Tour Guide Plugin](../references/qwc2_plugins.md#tourguide), you can customize your tour guide using a `.json` file.
4+
5+
By default, the file is located in the `static` folder of QWC, but you can also provide any JSON file using the `tourGuideUrl` parameter in the plugin configuration.
6+
7+
Each step of the tour can be configured using the following parameters:
8+
9+
- `selector`: (string) CSS selector to target an element by ID or class.
10+
**Default**: `null`
11+
12+
- `title`: (string) Title of the tour guide step card.
13+
**Default**: `""`
14+
15+
- `content`: (string) Content body of the tour guide step card.
16+
**Default**: `""`
17+
18+
- `side`: (string) Position of the step card relative to the highlighted element. Possible values include `"top"`, `"bottom"`, `"left"`, `"right"`.
19+
**Default**: `"left"`
20+
21+
- `align`: (string) Alignment of the card relative to its position. Possible values include `"start"`, `"center"`, `"end"`.
22+
**Default**: `"start"`
23+
24+
- `disableActiveInteraction`: (boolean) Whether to disable user interaction with the highlighted element.
25+
**Default**: `false`
26+
27+
In addition to the above parameters, it is also possible to configure tasks that will be triggered when moving to the next or previous steps:
28+
29+
- `onNextClick`: (array of strings) A list of actions to perform when the "Next" button is clicked.
30+
- `onPrevClick`: (array of strings) A list of actions to perform when the "Previous" button is clicked.
31+
32+
Supported actions include:
33+
34+
- `"setTask:<taskName>"` – Opens the specified task, or use `null` to close it.
35+
- `"openMenu"` – Opens the main menu.
36+
- `"closeMenu"` – Closes the main menu.
37+
- `"openSubMenu:<submenu>"` – Opens a specific submenu. For example: `"openSubMenu:tools"`
38+
39+
### Example JSON Configuration
40+
41+
```json
42+
[
43+
{
44+
"selector": ".Toolbar",
45+
"title": "Top Bar",
46+
"content": "The top bar toolbar is a configurable interface managed by the administrator. It hosts many tools available in the QGIS Web Client. Typically, you will find the most frequently used tools here, such as printing and measuring."
47+
},
48+
{
49+
"selector": "button[title='Switch background']",
50+
"title": "Background Switcher",
51+
"content": "This module allows you to change the map background. New backgrounds can be configured in the theme configuration file.",
52+
"side": "top"
53+
},
54+
{
55+
"selector": "#LayerTree",
56+
"title": "Layer Tree",
57+
"content": "Here you can manage the visibility and order of the map layers.",
58+
"onNextClick": ["setTask:null", "openMenu"],
59+
"onPrevClick": ["setTask:LayerTree", "closeMenu"]
60+
}
61+
]
62+
```
63+
64+
For a full example, you can refer to the [tourGuide.json](https://github.com/qgis/qwc2/blob/master/static/tourGuide.json) file in the QWC application.

0 commit comments

Comments
 (0)