DropDownmenü Element von API aufrufen in Kontextmenü ->Popup-> Station hinzufügen

This commit is contained in:
ISA
2024-05-02 14:26:36 +02:00
parent 7465069e44
commit c9c9e5feb3
5 changed files with 88 additions and 67 deletions

View File

@@ -21,7 +21,7 @@ import ShowAddStationPopup from "./ShowAddStationPopup";
//import { createRoot } from "react-dom/client";
const MapComponent = ({ locations, onLocationUpdate }) => {
const [poiTypData, setPoiTypData] = useRecoilState(poiTypState); // Recoil State verwenden
const [poiTypData, setPoiTypData] = useState(poiTypState); // Recoil State verwenden
const poiLayerRef = useRef(null); // Referenz auf die Layer-Gruppe für Datenbank-Marker
const mapRef = useRef(null); // Referenz auf das DIV-Element der Karte
const [map, setMap] = useState(null); // Zustand der Karteninstanz
@@ -415,11 +415,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
// Create a root container for the React component inside the popup
const root = ReactDOM.createRoot(container);
root.render(
<RecoilRoot>
<ShowAddStationPopup map={map} latlng={e.latlng} />
</RecoilRoot>
);
root.render(<ShowAddStationPopup map={map} latlng={e.latlng} />);
// Create and configure the popup
L.popup().setLatLng(e.latlng).setContent(container).openOn(initMap);