DropDownmenü Element von API aufrufen in Kontextmenü ->Popup-> Station hinzufügen
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user