Skip to content

Commit b819cfa

Browse files
authored
Merge pull request #309 from GeotrekCE/mfu-improve-doc
[Doc] Add config examples
2 parents a59e5bb + d9e60ff commit b819cfa

File tree

4 files changed

+196
-0
lines changed

4 files changed

+196
-0
lines changed

docs/.vitepress/config/en.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ function sidebar(): DefaultTheme.SidebarItem[] {
4343
{ text: 'Offline', link: '/en/documentation/features/offline' }
4444
]
4545
},
46+
{
47+
text: 'Configuration',
48+
items: [
49+
{ text: 'Configuration', link: '/en/documentation/configuration/configuration' }
50+
]
51+
},
4652
{
4753
text: 'Architecture',
4854
items: [

docs/.vitepress/config/fr.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ function sidebar(): DefaultTheme.SidebarItem[] {
4343
{ text: 'Offline', link: '/documentation/features/offline' }
4444
]
4545
},
46+
{
47+
text: 'Configuration',
48+
items: [
49+
{ text: 'Configuration', link: '/documentation/configuration/configuration' }
50+
]
51+
},
4652
{
4753
text: 'Architecture',
4854
items: [
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Principales options de configuration
2+
3+
Cette page présente les principales options de configuration à modifier dans le fichier :
4+
5+
`mobile/config/src/environments/environment.prod.ts`
6+
7+
## Activer la page d'accueil
8+
9+
Par défaut, l’application présente un affichage des itinéraires par liste ou par vignette. Pour afficher une **page d'accueil** avec un menu :
10+
11+
Modifier la ligne suivante :
12+
13+
```diff
14+
- navigation: 'tabs',
15+
+ navigation: 'menu',
16+
```
17+
18+
## Afficher les vignettes vers les pratiques outdoor
19+
20+
Pour activer l’affichage des **pratiques outdoor** (via ferrata, escalade, parapente, etc.) en page d’accueil :
21+
22+
Modifier la ligne suivante :
23+
24+
```diff
25+
- enableOutdoorPracticesShortcuts: false,
26+
+ enableOutdoorPracticesShortcuts: { portals: [] },
27+
```
28+
29+
**Astuce** :
30+
Si vous souhaitez activer cette fonctionnalité uniquement pour certains portails, ajoutez leurs identifiants dans le tableau `portals`.
31+
32+
Exemple :
33+
34+
```ts
35+
enableOutdoorPracticesShortcuts: { portals: ['2,5'] },
36+
```
37+
38+
## Choisir le tri initial des itinéraires
39+
40+
L’ordre d’affichage initial des contenus peut être défini par l’une des options suivantes :
41+
42+
* `alphabetical` (ordre alphabétique, par défaut)
43+
* `random` (ordre aléatoire)
44+
* `location` (par proximité géographique)
45+
46+
Exemple pour un tri par **proximité géographique** :
47+
48+
```ts
49+
initialOrder: 'location',
50+
```
51+
52+
## Définir la distance de déclenchement des notifications POI
53+
54+
L’application peut notifier l’utilisateur à l’approche d’un point d’intérêt (POI).
55+
56+
Pour modifier la distance à partir de laquelle la notification s’affiche (en mètres) :
57+
58+
```ts
59+
metersToNotify: 200,
60+
```
61+
62+
Exemple : pour notifier à 300 mètres :
63+
64+
```ts
65+
metersToNotify: 300,
66+
```
67+
68+
## Modifier le fond de carte
69+
70+
Voici un exemple de configuration pour afficher le fond de carte **Plan IGN V2** :
71+
72+
```ts
73+
sources: {
74+
'tiles-background': {
75+
type: 'raster',
76+
tiles: [
77+
'https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&STYLE=normal&FORMAT=image/png&TILEMATRIXSET=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}'
78+
],
79+
tileSize: 256
80+
}
81+
}
82+
```
83+
84+
**À noter** :
85+
- Il est possible d’utiliser d’autres fonds de carte compatibles avec Mapbox GL JS (raster ou vectoriel), en adaptant l’URL et les paramètres `sources` et `layers`.
86+
- Les tuiles pour le mode hors lignes sont à configurer côté Geotrek-admin (voir le paramètre `MOBILE_TILES_URL` dans le fichier [geotrek/settings/base.py](https://github.com/GeotrekCE/Geotrek-admin/blob/master/geotrek/settings/base.py))
87+
88+
# Paramètres de configuration disponibles
89+
90+
Vous pouvez consulter l’ensemble des paramètres configurables pour la personnalisation de l’application mobile dans le fichier suivant : [/main/src/environments/environment.prod.ts](https://github.com/GeotrekCE/Geotrek-mobile/blob/main/src/environments/environment.prod.ts)
91+
92+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Main configuration options
2+
3+
This page presents the main configuration options that can be modified in the following file:
4+
5+
`mobile/config/src/environments/environment.prod.ts`
6+
7+
## Enable the home page
8+
9+
By default, the application displays treks in a list or grid view. To display a **home page** with a menu:
10+
11+
Edit the following line:
12+
13+
```diff
14+
- navigation: 'tabs',
15+
+ navigation: 'menu',
16+
```
17+
18+
## Display shortcuts to outdoor practices
19+
20+
To enable the display of **outdoor practices** (via ferrata, climbing, paragliding, etc.) on the home page:
21+
22+
Edit the following line:
23+
24+
```diff
25+
- enableOutdoorPracticesShortcuts: false,
26+
+ enableOutdoorPracticesShortcuts: { portals: [] },
27+
```
28+
29+
**Tip**:
30+
If you want to enable this feature only for certain portals, add their IDs to the `portals` array.
31+
32+
Example:
33+
34+
```ts
35+
enableOutdoorPracticesShortcuts: { portals: ['2,5'] },
36+
```
37+
38+
## Set the initial treks sorting order
39+
40+
The default display order of treks can be set to one of the following options:
41+
42+
* `alphabetical` (alphabetical order, default)
43+
* `random` (random order)
44+
* `location` (by geographical proximity)
45+
46+
Example for sorting by **geographical proximity**:
47+
48+
```ts
49+
initialOrder: 'location',
50+
```
51+
52+
## Set the notification distance for POIs
53+
54+
The app can notify users when approaching a Point of Interest (POI).
55+
56+
To change the distance (in meters) at which the notification is triggered:
57+
58+
```ts
59+
metersToNotify: 200,
60+
```
61+
62+
Example: to trigger the notification at 300 meters:
63+
64+
```ts
65+
metersToNotify: 300,
66+
```
67+
68+
## Change the map background
69+
70+
Here is an example configuration to display the **IGN Plan V2** map background:
71+
72+
```ts
73+
sources: {
74+
'tiles-background': {
75+
type: 'raster',
76+
tiles: [
77+
'https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&STYLE=normal&FORMAT=image/png&TILEMATRIXSET=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}'
78+
],
79+
tileSize: 256
80+
}
81+
}
82+
```
83+
84+
**Note**:
85+
86+
* You can use other raster or vector tile sources compatible with Mapbox GL JS by adapting the `sources` and `layers` parameters.
87+
* Offline map tiles must be configured in Geotrek-admin (see the `MOBILE_TILES_URL` setting in the [geotrek/settings/base.py](https://github.com/GeotrekCE/Geotrek-admin/blob/master/geotrek/settings/base.py) file).
88+
89+
# Available Configuration Parameters
90+
91+
You can find all available parameters for customizing the mobile app in the following file: [/main/src/environments/environment.prod.ts](https://github.com/GeotrekCE/Geotrek-mobile/blob/main/src/environments/environment.prod.ts)
92+

0 commit comments

Comments
 (0)