Repository navigation
Expand file tree
/
Copy pathbasic-examples.html
More file actions
261 lines (250 loc) · 19.8 KB
/
Copy pathbasic-examples.html
File metadata and controls
261 lines (250 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BAM - Basic examples</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container mt-4">
<h1>
<img
src="https://pnx-si.github.io/BAM-widget/assets/BAM-logo-B7M8Ftx4.png"
height="50px"
allow="geolocation"
/>
BAM widget basic integration examples
</h1>
<!-- Tabs -->
<ul class="nav nav-tabs" id="bamTab" role="tablist">
<li class="nav-item" role="presentation">
<button
class="nav-link active"
id="tab1-tab"
data-bs-toggle="tab"
data-bs-target="#tab1"
type="button"
role="tab"
>
📋 Simple list (EN)
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="tab2-tab"
data-bs-toggle="tab"
data-bs-target="#tab2"
type="button"
role="tab"
>
🗺️ Map + Gallery (FR)
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="tab3-tab"
data-bs-toggle="tab"
data-bs-target="#tab3"
type="button"
role="tab"
>
🤏 Smaller list
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="tab4-tab"
data-bs-toggle="tab"
data-bs-target="#tab4"
type="button"
role="tab"
>
📍 Interactive area
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="tab5-tab"
data-bs-toggle="tab"
data-bs-target="#tab5"
type="button"
role="tab"
>
🏠 Cards
</button>
</li>
</ul>
<!-- Tabs content -->
<div class="tab-content mt-3" id="bamTabContent">
<!-- Tab 1 -->
<div
class="tab-pane fade show active"
id="tab1"
role="tabpanel"
>
<p class="text-muted">
Observed species around Ecrins National Park (Gap) and
other locations.
</p>
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=100&wkt=POLYGON ((6.054455533106915 44.57647499304567, 6.054431277623446 44.57665044200969, 6.0543594354001575 44.57681914906764, 6.054242766932902 44.57697463081617, 6.054085755484563 44.57711091205043, 6.053894434832445 44.577222755407625, 6.053676157406486 44.57730586265875, 6.053439311726622 44.577357039910424, 6.053193 44.57737432036373, 6.052946688273379 44.577357039910424, 6.052709842593514 44.57730586265875, 6.052491565167555 44.577222755407625, 6.052300244515438 44.57711091205043, 6.052143233067099 44.57697463081617, 6.052026564599844 44.57681914906764, 6.051954722376555 44.57665044200969, 6.051930466893086 44.57647499304567, 6.05195472984884 44.576299544611025, 6.052026578406827 44.57613083906055, 6.052143251106792 44.575975359568204, 6.052300264041461 44.57583908099523, 6.052491583207249 44.57572724029936, 6.052709856400498 44.57564413530436, 6.052946695745664 44.57559295956022, 6.053193 44.57557567963628, 6.053439304254336 44.57559295956022, 6.053676143599503 44.57564413530436, 6.053894416792752 44.57572724029936, 6.05408573595854 44.57583908099523, 6.054242748893209 44.575975359568204, 6.0543594215931735 44.57613083906055, 6.05443127015116 44.576299544611025, 6.054455533106915 44.57647499304567))&connector=GBIF&nbTaxonPerLine=4&showFilters=false&mapEditable=true&lang=en&mode=detailedList&widgetType=list&switchModeAvailable=true&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=wikidata"
style="width: 100%; height: 800px"
allow="geolocation"
loading="lazy"
></iframe>
</div>
<!-- Tab 2 -->
<div class="tab-pane fade" id="tab2" role="tabpanel">
<p class="text-muted">
Same searching area, in French
<i
>(interface and species names, actually available in
EN, FR and ES, easy to add additional languages)</i
>, with map of the searching area, with filters, in
gallery display mode
<i>(without changing display mode button)</i>, with GBIF
pictures (instead of Wikidata pictures).
</p>
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=100&wkt=POLYGON ((6.054455533106915 44.57647499304567, 6.054431277623446 44.57665044200969, 6.0543594354001575 44.57681914906764, 6.054242766932902 44.57697463081617, 6.054085755484563 44.57711091205043, 6.053894434832445 44.577222755407625, 6.053676157406486 44.57730586265875, 6.053439311726622 44.577357039910424, 6.053193 44.57737432036373, 6.052946688273379 44.577357039910424, 6.052709842593514 44.57730586265875, 6.052491565167555 44.577222755407625, 6.052300244515438 44.57711091205043, 6.052143233067099 44.57697463081617, 6.052026564599844 44.57681914906764, 6.051954722376555 44.57665044200969, 6.051930466893086 44.57647499304567, 6.05195472984884 44.576299544611025, 6.052026578406827 44.57613083906055, 6.052143251106792 44.575975359568204, 6.052300264041461 44.57583908099523, 6.052491583207249 44.57572724029936, 6.052709856400498 44.57564413530436, 6.052946695745664 44.57559295956022, 6.053193 44.57557567963628, 6.053439304254336 44.57559295956022, 6.053676143599503 44.57564413530436, 6.053894416792752 44.57572724029936, 6.05408573595854 44.57583908099523, 6.054242748893209 44.575975359568204, 6.0543594215931735 44.57613083906055, 6.05443127015116 44.576299544611025, 6.054455533106915 44.57647499304567))&connector=GBIF&nbTaxonPerLine=2&showFilters=true&mapEditable=false&lang=fr&mode=gallery&widgetType=mapList&switchModeAvailable=false&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=gbif"
style="width: 100%; height: 800px"
allow="geolocation"
loading="lazy"
></iframe>
</div>
<!-- Tab 3 -->
<div class="tab-pane fade" id="tab3" role="tabpanel">
<p class="text-muted">
Here without map, in a smaller part of the page and
bigger results.
</p>
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=100&wkt=POLYGON ((6.054455533106915 44.57647499304567, 6.054431277623446 44.57665044200969, 6.0543594354001575 44.57681914906764, 6.054242766932902 44.57697463081617, 6.054085755484563 44.57711091205043, 6.053894434832445 44.577222755407625, 6.053676157406486 44.57730586265875, 6.053439311726622 44.577357039910424, 6.053193 44.57737432036373, 6.052946688273379 44.577357039910424, 6.052709842593514 44.57730586265875, 6.052491565167555 44.577222755407625, 6.052300244515438 44.57711091205043, 6.052143233067099 44.57697463081617, 6.052026564599844 44.57681914906764, 6.051954722376555 44.57665044200969, 6.051930466893086 44.57647499304567, 6.05195472984884 44.576299544611025, 6.052026578406827 44.57613083906055, 6.052143251106792 44.575975359568204, 6.052300264041461 44.57583908099523, 6.052491583207249 44.57572724029936, 6.052709856400498 44.57564413530436, 6.052946695745664 44.57559295956022, 6.053193 44.57557567963628, 6.053439304254336 44.57559295956022, 6.053676143599503 44.57564413530436, 6.053894416792752 44.57572724029936, 6.05408573595854 44.57583908099523, 6.054242748893209 44.575975359568204, 6.0543594215931735 44.57613083906055, 6.05443127015116 44.576299544611025, 6.054455533106915 44.57647499304567))&connector=GBIF&nbTaxonPerLine=2&showFilters=false&mapEditable=true&lang=fr&mode=gallery&widgetType=list&switchModeAvailable=true&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=wikidata"
style="width: 50%; height: 800px"
allow="geolocation"
loading="lazy"
></iframe>
<img
src="https://media.githubusercontent.com/media/PnX-SI/BAM-widget/refs/heads/main/docs/images/BAM-logo-full.png"
width="50%"
align="right"
/>
</div>
<!-- Tab 4 -->
<div class="tab-pane fade" id="tab4" role="tabpanel">
<p class="text-muted">
Here you can draw the searching area on the map, or
geolocate.
</p>
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=100&connector=GBIF&nbTaxonPerLine=2&showFilters=true&mapEditable=true&lang=en&mode=detailedList&widgetType=mapList&switchModeAvailable=true&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=wikidata"
style="width: 100%; height: 800px"
allow="geolocation"
loading="lazy"
></iframe>
</div>
<!-- Tab 5 -->
<div class="tab-pane fade" id="tab5" role="tabpanel">
<p class="text-muted">
Observed species in 200 meters around Ecrins national
park houses.
</p>
<div class="row">
<!-- Valbonnais house -->
<div class="col-md-4 mb-3">
<div class="card">
<img
src="https://www.ecrins-parcnational.fr/sites/ecrins-parcnational.com/files/styles/squared/public/lieu/25590/31867041.jpg?itok=cYU5c4dY"
class="card-img-top"
alt="Valbonnais"
/>
<div class="card-body">
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=200&wkt=POLYGON ((5.95173228978356 44.90125897186549, 5.951683513242662 44.901609870334774, 5.951539025944855 44.901947285992485, 5.951304378989245 44.90225825179706, 5.95098858874663 44.90253081698763, 5.950603790514671 44.902754506424074, 5.9501647722176445 44.90292072323407, 5.949688406062459 44.90302307927935, 5.949193 44.90305764072745, 5.948697593937541 44.90302307927935, 5.948221227782357 44.90292072323407, 5.9477822094853305 44.902754506424074, 5.9473974112533705 44.90253081698763, 5.947081621010756 44.90225825179706, 5.946846974055147 44.901947285992485, 5.9467024867573395 44.901609870334774, 5.946653710216441 44.90125897186549, 5.946702517157566 44.9009080755378, 5.946847030227441 44.900570665978904, 5.947081694403396 44.90025970930183, 5.9473974906929925 44.89998715487786, 5.947782282877971 44.89976347620803, 5.948221283954651 44.899597268525525, 5.948697624337769 44.899494918579016, 5.949193 44.89946035927255, 5.949688375662232 44.899494918579016, 5.95016471604535 44.899597268525525, 5.950603717122029 44.89976347620803, 5.950988509307009 44.89998715487786, 5.951304305596605 44.90025970930183, 5.951538969772559 44.900570665978904, 5.951683482842435 44.9009080755378, 5.95173228978356 44.90125897186549))&connector=GBIF&nbTaxonPerLine=2&showFilters=false&mapEditable=true&lang=fr&mode=detailedList&widgetType=list&switchModeAvailable=true&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=wikidata"
style="width: 100%; height: 500px"
allow="geolocation"
loading="lazy"
></iframe>
</div>
</div>
</div>
<!-- Embrunais house -->
<div class="col-md-4 mb-3">
<div class="card">
<img
src="https://www.ecrins-parcnational.fr/sites/ecrins-parcnational.com/files/styles/squared/public/lieu/25559/31866978.jpg?itok=MVD6YlOi"
class="card-img-top"
alt="Embrunais"
/>
<div class="card-body">
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=200&wkt=POLYGON ((6.523405738756567 44.61495297214528, 6.523357203154589 44.615303870603924, 6.523213429891146 44.615641286231316, 6.5229799426471695 44.6159522519905, 6.522665713240933 44.61622481712753, 6.52228281699314 44.616448506510444, 6.52184596873078 44.616614723275056, 6.521371957253003 44.61671707929001, 6.520879 44.61675164072746, 6.520386042746996 44.61671707929001, 6.51991203126922 44.616614723275056, 6.51947518300686 44.616448506510444, 6.519092286759067 44.61622481712753, 6.51877805735283 44.6159522519905, 6.518544570108854 44.615641286231316, 6.518400796845411 44.615303870603924, 6.518352261243432 44.61495297214528, 6.518400826794554 44.61460207580694, 6.518544625447656 44.61426466621772, 6.518778129656458 44.613953709495256, 6.51909236501995 44.61368115501776, 6.519475255310488 44.61345747629439, 6.519912086608021 44.613291268566506, 6.52038607269614 44.61318891858967, 6.520879 44.613154359272556, 6.52137192730386 44.61318891858967, 6.52184591339198 44.613291268566506, 6.5222827446895115 44.61345747629439, 6.52266563498005 44.61368115501776, 6.5229798703435415 44.613953709495256, 6.523213374552344 44.61426466621772, 6.523357173205445 44.61460207580694, 6.523405738756567 44.61495297214528))&connector=GBIF&nbTaxonPerLine=2&showFilters=false&mapEditable=true&lang=fr&mode=gallery&widgetType=list&switchModeAvailable=true&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=wikidata"
style="width: 100%; height: 500px"
allow="geolocation"
loading="lazy"
></iframe>
</div>
</div>
</div>
<!-- Champsaur house -->
<div class="col-md-4 mb-3">
<div class="card">
<img
src="https://www.ecrins-parcnational.fr/sites/ecrins-parcnational.com/files/styles/squared/public/lieu/25588/31864917.jpg?itok=ERhFKIvi"
class="card-img-top"
alt="Champsaur"
/>
<div class="card-body">
<iframe
data-src="https://pnx-si.github.io/BAM-widget/#/?buffer=200&wkt=POLYGON ((6.230366019631896 44.667301972094336, 6.230317440244471 44.66765287055491, 6.230173537220814 44.66799028618782, 6.229939839224519 44.66830125195526, 6.229625326170313 44.66857381710206, 6.229242084278405 44.66879750649472, 6.22880484165962 44.668963723267595, 6.228330402270642 44.66906607928807, 6.227837000000001 44.66910064072746, 6.227343597729359 44.66906607928807, 6.2268691583403815 44.668963723267595, 6.226431915721596 44.66879750649472, 6.226048673829688 44.66857381710206, 6.225734160775482 44.66830125195526, 6.225500462779187 44.66799028618782, 6.22535655975553 44.66765287055491, 6.225307980368105 44.667301972094336, 6.225356589786538 44.666951075757936, 6.225500518269255 44.66661366617423, 6.225734233276751 44.666302709460034, 6.226048752304496 44.666030154992285, 6.226431988222865 44.66580647627867, 6.226869213830451 44.66564026855904, 6.227343627760368 44.66553791858773, 6.227837000000001 44.665503359272556, 6.228330372239633 44.66553791858773, 6.22880478616955 44.66564026855904, 6.229242011777136 44.66580647627867, 6.229625247695505 44.666030154992285, 6.22993976672325 44.666302709460034, 6.230173481730746 44.66661366617423, 6.230317410213463 44.666951075757936, 6.230366019631896 44.667301972094336))&connector=GBIF&nbTaxonPerLine=2&showFilters=false&mapEditable=true&lang=fr&mode=gallery&widgetType=list&switchModeAvailable=true&GBIF_ENDPOINT=https://api.gbif.org/v1&LIMIT=300&NB_PAGES=10&soundSource=gbif&imageSource=wikidata"
style="width: 100%; height: 500px"
allow="geolocation"
loading="lazy"
></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Script for lazy (deferred) loading of iframes -->
<script>
document.addEventListener('DOMContentLoaded', function () {
const tabEl = document.querySelectorAll(
'button[data-bs-toggle="tab"]'
);
tabEl.forEach((btn) => {
btn.addEventListener('shown.bs.tab', function (event) {
const target = document.querySelector(
event.target.getAttribute('data-bs-target')
);
const iframes =
target.querySelectorAll('iframe[data-src]');
iframes.forEach((iframe) => {
if (!iframe.src) {
iframe.src = iframe.getAttribute('data-src');
}
});
});
});
// Default loading of the first tab content
const firstTab = document.querySelector('.tab-pane.active');
const firstIframe =
firstTab.querySelectorAll('iframe[data-src]');
firstIframe.forEach((iframe) => {
iframe.src = iframe.getAttribute('data-src');
});
});
</script>
</body>
</html>