import React, { useEffect, useRef, useState } from "react";
import L from "leaflet";
import "leaflet/dist/leaflet.css";
const MapComponent = () => {
const mapRef = useRef(null);
const [map, setMap] = useState(null);
function addMarker(map) {
const marker = L.marker([53.111111, 8.4625]).addTo(map);
marker.bindPopup("Hallo Welt!
Ich bin ein Popup.").openPopup();
}
useEffect(() => {
if (mapRef.current && !map) {
const initialMap = L.map(mapRef.current, {
center: [53.111111, 8.4625],
zoom: 10,
zoomControl: false, // Deaktiviere die Standard-Zoomsteuerung
});
initialMap.on("contextmenu", (event) => {
L.popup()
.setLatLng(event.latlng)
.setContent('