delete: nominatim online , weil wird nicht gebraucht, weil benötigt seh viel RAM und Stadt Suche per Name wird nicht gebraucht, aktuell nur Koordinaten eingeben in der Suche und das kann Leaflet schon

This commit is contained in:
Ismail Ali
2025-05-17 09:05:39 +02:00
parent e01c6f9324
commit 12eb84f267
4 changed files with 1 additions and 52 deletions

View File

@@ -7,7 +7,6 @@ DB_NAME=talas_v5
DB_PORT=3306
# Public Settings (Client braucht IP/Domain) , Variablen mit dem Präfix "NEXT_PUBLIC" ist in Browser sichtbar
NEXT_PUBLIC_ENABLE_GEOCODER=true
NEXT_PUBLIC_USE_MOCK_API=false
NEXT_PUBLIC_DEBUG_LOG=true

View File

@@ -1,49 +0,0 @@
// components/features/GeocoderFeature.js
export function initGeocoderFeature(map) {
// Feature Toggle
const isGeocoderEnabled = process.env.NEXT_PUBLIC_ENABLE_GEOCODER === "true";
if (!isGeocoderEnabled) return; // Falls deaktiviert, nichts ausführen
// Benutzerdefiniertes Icon erstellen
const customIcon = L.icon({
iconUrl: "/img/marker-icon.png",
iconSize: [32, 32],
iconAnchor: [16, 32],
popupAnchor: [0, -32],
});
// Geocoder hinzufügen
const geocoder = L.Control.geocoder({
position: "topleft",
defaultMarkGeocode: false,
errorMessage: "", // Keine Fehlermeldung anzeigen
geocoder: new L.Control.Geocoder.Nominatim({
serviceUrl: "https://nominatim.openstreetmap.org/",
geocodingQueryParams: {
"accept-language": "de",
countrycodes: "DE",
},
}),
})
.on("markgeocode", function (e) {
const latlng = e.geocode.center;
map.setView(latlng, 15);
L.marker(latlng, { icon: customIcon }).addTo(map).bindPopup(e.geocode.name).openPopup();
})
.addTo(map);
// Styling mit Tailwind CSS
setTimeout(() => {
const geocoderContainer = document.querySelector(".leaflet-control-geocoder");
if (geocoderContainer) {
geocoderContainer.classList.add("shadow-md", "border", "border-gray-300", "rounded-full", "bg-white", "p-2", "w-96");
const geocoderInput = geocoderContainer.querySelector("input");
if (geocoderInput) {
geocoderInput.classList.add("border-none", "outline-none", "w-full", "text-sm", "text-gray-700", "pl-3");
geocoderInput.placeholder = "Ort oder Adresse suchen...";
}
}
}, 100);
}

View File

@@ -35,7 +35,6 @@ import useLineData from "../../hooks/useLineData.js";
//import { useCreateAndSetDevices } from "../hooks/useCreateAndSetDevices";
import { useMapComponentState } from "../../hooks/useMapComponentState.js";
import { updateLocation } from "../../utils/updateBereichUtil.js";
import { initGeocoderFeature } from "../features/GeocoderFeature.js";
//--------------------------------------------
//import { currentPoiState } from "../redux/slices/currentPoiSlice.js";

View File

@@ -1,2 +1,2 @@
// /config/appVersion
export const APP_VERSION = "1.1.79";
export const APP_VERSION = "1.1.80";