Skip to content

Commit 4b17864

Browse files
committed
Add BAM widget example
1 parent 722638d commit 4b17864

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

docs/customization/customization-htmlscripts.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,53 @@ Here is some examples but there is a lot more that can be done, your imagination
146146

147147
**Configuration** [Check this comment](https://github.com/GeotrekCE/Geotrek-rando-v3/issues/914#issuecomment-1779758757)
148148

149+
##### **BAM widget**
150+
151+
The BAM widget is an open-source biodiversity widget developed by French National Parks. It can be integrated into Geotrek-rando detail pages to display biodiversity observations around a trek or other touristic content.
152+
153+
When a trek detail page is displayed, the BAM widget retrieves the trek geometry from the Geotrek-admin API as GeoJSON. It then creates a buffer around this geometry (the buffer size in meters is defined in the widget parameters, 100 m in the example below) and queries a biodiversity data source to retrieve observations within this area. By default, the data source is GBIF, but it can be replaced by Wikidata or a GeoNature instance to generate a list of observed species.
154+
155+
For more information about the widget, please visit the [project's GitHub page](https://github.com/PnX-SI/BAM-widget/).
156+
157+
###### Integration steps
158+
159+
- Copy the widget template into your Geotrek-rando customization folder, for example:
160+
`customization/html/details/BAMwidget.html`
161+
- In the iframe configuration, replace
162+
`https://geotrekdemo.ecrins-parcnational.fr`
163+
with the URL of your own Geotrek-admin instance.
164+
- Adjust widget parameters if needed (buffer size, filters visibility, display mode, number of species per line, or data source). Refer to the [BAM documentation](https://pnx-si.github.io/BAM-widget/docs/#/get-started) and [configurator](https://pnx-si.github.io/BAM-widget/#/config?filtersOnList=true&buffer=500&connector=GBIF&nbTaxonPerLine=2&showFilters=false&mapEditable=true&lang=fr&mode=detailedList&widgetType=list&switchModeAvailable=false&primaryColor=aaa&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=wikidata&imageSource=wikidata) for the full list of available parameters.
165+
- Declare the widget and its position in the `customization/config/details.json` file. Example:
166+
167+
```json
168+
"trek": [
169+
{
170+
"name": "BAMwidget",
171+
"display": true,
172+
"anchor": false,
173+
"order": 60
174+
}
175+
]
176+
````
177+
178+
- Add a translated title for the widget block in your custom translations file. Example in `customization/translations/fr.json`:
179+
180+
```json
181+
"details": {
182+
"BAMwidget": "Biodiversité autour de cet itinéraire"
183+
}
184+
```
185+
186+
###### Example iframe configuration
187+
188+
```html
189+
<iframe
190+
src="https://pnx-si.github.io/BAM-widget/#/?showFilters=false&sourceGeometry=https://geotrekdemo.ecrins-parcnational.fr/api/v2/trek/{{ id }}/?fields=geometry%26format=geojson&buffer=100&connector=gbif&nbTaxonPerLine=4&widgetType=list"
191+
style="height: 80vh"
192+
allow="geolocation">
193+
</iframe>
194+
```
195+
149196
##### **Sustainable transport route planner**
150197

151198
Multiple widgets can be added to help citizens plan their trip using sustainable transports. Here is some examples but we advise you to look for local solutions, there is a good chance your country / state / city may have an existing widget that you can integrate on your website.

0 commit comments

Comments
 (0)