mirror of
https://gitlab.com/little-lines/frontend.git
synced 2024-11-10 06:54:26 +00:00
access to wheelchar data
This commit is contained in:
parent
760d868dc2
commit
3c4499cb66
1 changed files with 20 additions and 0 deletions
|
@ -180,6 +180,26 @@ const handleMapClick = async event => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching reverse geocoding data:", error);
|
console.error("Error fetching reverse geocoding data:", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const overpassQuery = `[out:json];
|
||||||
|
(
|
||||||
|
node(around:1000,${clickedCoordinate[1]},${clickedCoordinate[0]})["wheelchair"="yes"];
|
||||||
|
way(around:1000,${clickedCoordinate[1]},${clickedCoordinate[0]})["wheelchair"="yes"];
|
||||||
|
relation(around:1000,${clickedCoordinate[1]},${clickedCoordinate[0]})["wheelchair"="yes"];
|
||||||
|
);
|
||||||
|
out;`;
|
||||||
|
const overpassUrl = 'https://overpass-api.de/api/interpreter';
|
||||||
|
|
||||||
|
axios.post(overpassUrl, `data=${encodeURIComponent(overpassQuery)}`, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
}).then(response => {
|
||||||
|
// Process the data returned by the Overpass API
|
||||||
|
console.log(response.data);
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('Error fetching data from Overpass API:', error);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const closePopup = () => {
|
const closePopup = () => {
|
||||||
|
|
Loading…
Reference in a new issue