geoencoding searhc

This commit is contained in:
Valentin CZERYBA 2023-11-11 19:16:05 +01:00
parent 5d70b58fa7
commit 552da4c577
2 changed files with 12 additions and 6 deletions

View File

@ -9,11 +9,10 @@
<title>Dashboard Template · Bootstrap v5.2</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/dashboard/">
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.css" type="text/css">
<link href="../css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- Favicons -->
@ -24,7 +23,9 @@
<link rel="mask-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon.ico">
<meta name="theme-color" content="#712cf9">
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<style>
@ -182,7 +183,6 @@
<span class="input-group-text" id="placeUpdate">Lieu</span>
<input id="placeUpdateInput" type="text" class="form-control" placeholder="Lieu" aria-label="Lieu" aria-describedby="placeUpdate">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="start_dateUpdate">Date de début de l'évènement</span>
<input id="start_dateUpdateInput" type="datetime-local" class="form-control" placeholder="Date de début de l'évènement" aria-label="Date de début de l'évènement" aria-describedby="start_dateUpdate">
@ -204,8 +204,6 @@
</main>
</div>
</div>
<script src="../js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
@ -213,4 +211,5 @@
<script src="../js/config.js"></script>
<script src="../js/library.js"></script>
<script src="../js/addItem.js"></script>
<script src="../js/geosearch.js"></script>
</body></html>

7
web/js/geosearch.js Normal file
View File

@ -0,0 +1,7 @@
mapboxgl.accessToken = 'pk.eyJ1IjoidmFsY3plODAiLCJhIjoiY2xpY2FhOTM5MGxwczNrdGV6a2J1Z2Q4diJ9.I_WRpX1aO4z32ajcE2Ef7A';
const geocoder = new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
types: 'country,region,place,postcode,locality,neighborhood'
});
geocoder.addTo('#placeUpdateInput');