chore: entferne AddPOIOnPolyline-Komponente

This commit is contained in:
ISA
2025-05-23 09:19:36 +02:00
parent 8cb995040d
commit 08679761fb
3 changed files with 1 additions and 67 deletions

View File

@@ -1,63 +0,0 @@
// /components/AddPOIOnPolyline.js
import React, { useState, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { closeAddPoiOnPolylineModal } from "../redux/slices/addPoiOnPolylineSlice";
const AddPOIOnPolyline = () => {
const dispatch = useDispatch();
const { isOpen, latlng } = useSelector((state) => state.addPoiOnPolyline);
const [name, setName] = useState("");
const [latitude, setLatitude] = useState("");
const [longitude, setLongitude] = useState("");
useEffect(() => {
if (latlng) {
setLatitude(latlng.lat.toFixed(5));
setLongitude(latlng.lng.toFixed(5));
}
}, [latlng]);
if (!isOpen) return null;
const handleSubmit = async (event) => {
alert("POI auf Polyline hinzufügen");
event.preventDefault();
const formData = { name, latitude, longitude };
console.log("Neuer POI auf Polyline:", formData);
dispatch(closeAddPoiOnPolylineModal()); // Schließt das Modal nach dem Speichern
};
return (
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50" onClick={() => dispatch(closeAddPoiOnPolylineModal())}>
<div className="bg-white p-6 rounded-lg shadow-lg w-96 max-w-full" onClick={(e) => e.stopPropagation()}>
<h2 className="text-lg font-bold mb-4">POI auf Polyline hinzufügen</h2>
<form onSubmit={handleSubmit}>
<div className="mb-4">
<label className="block">Name:</label>
<input type="text" value={name} onChange={(e) => setName(e.target.value)} className="border p-2 w-full" required />
</div>
<div className="mb-4">
<label className="block">Latitude:</label>
<input type="text" value={latitude} readOnly className="border p-2 w-full" />
</div>
<div className="mb-4">
<label className="block">Longitude:</label>
<input type="text" value={longitude} readOnly className="border p-2 w-full" />
</div>
<button type="submit" className="bg-blue-500 hover:bg-blue-700 text-white p-2 rounded w-full">
Speichern
</button>
</form>
</div>
</div>
);
};
export default AddPOIOnPolyline;

View File

@@ -39,7 +39,6 @@ import { selectPolylineVisible, setPolylineVisible } from "../../redux/slices/po
import { selectGisStationsStaticDistrict } from "../../redux/slices/webservice/gisStationsStaticDistrictSlice.js"; import { selectGisStationsStaticDistrict } from "../../redux/slices/webservice/gisStationsStaticDistrictSlice.js";
import { selectGisSystemStatic, setGisSystemStatic } from "../../redux/slices/webservice/gisSystemStaticSlice.js"; import { selectGisSystemStatic, setGisSystemStatic } from "../../redux/slices/webservice/gisSystemStaticSlice.js";
import ShowAddStationPopup from "../pois/AddPOIModal.js"; import ShowAddStationPopup from "../pois/AddPOIModal.js";
import AddPOIOnPolyline from "../AddPOIOnPolyline";
import { enablePolylineEvents, disablePolylineEvents } from "../../utils/polylines/eventHandlers"; import { enablePolylineEvents, disablePolylineEvents } from "../../utils/polylines/eventHandlers";
import { updateCountdown, closePolylineContextMenu } from "../../redux/slices/polylineContextMenuSlice"; import { updateCountdown, closePolylineContextMenu } from "../../redux/slices/polylineContextMenuSlice";
//-------------------MapComponent.js hooks-------------------- //-------------------MapComponent.js hooks--------------------
@@ -863,8 +862,6 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
//-------------------------------------------- //--------------------------------------------
return ( return (
<> <>
{useSelector((state) => state.addPoiOnPolyline.isOpen) && <AddPOIOnPolyline />}
{/* Zeigt das POI-Modal, wenn `showPoiModal` true ist */} {/* Zeigt das POI-Modal, wenn `showPoiModal` true ist */}
{showPoiModal && <ShowAddStationPopup latlng={popupCoordinates} onClose={() => setShowPoiModal(false)} />} {showPoiModal && <ShowAddStationPopup latlng={popupCoordinates} onClose={() => setShowPoiModal(false)} />}
<ToastContainer /> <ToastContainer />

View File

@@ -1,2 +1,2 @@
// /config/appVersion // /config/appVersion
export const APP_VERSION = "1.1.152"; export const APP_VERSION = "1.1.153";