Poi hinzufügen per Popup Formular

This commit is contained in:
ISA
2024-05-02 20:46:39 +02:00
parent 31803907b9
commit 5986de04dd
2 changed files with 19 additions and 10 deletions

View File

@@ -28,12 +28,23 @@ const ShowAddStationPopup = ({ map, latlng }) => {
const handleSubmit = (event) => {
event.preventDefault();
console.log("Daten von ShowAddStationPopup: ", {
const formData = {
name, // Name der Station
poiTypeId, // Typ der Station, logged as idPoiTyp
latitude, // Breitengrad
longitude, // Längengrad
});
};
fetch('/api/addLocation', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(formData),
})
.then((response) => response.json())
.then((data) => console.log(data)) // Handle the response data
.catch((error) => console.error(error)); // Handle any errors
// Close the popup
//map.closePopup();
};