Poi hinzufügen per Popup Formular
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user