From 6f9a50ef5ca8dac2742d265952373cbde6e7d7e1 Mon Sep 17 00:00:00 2001 From: ISA Date: Tue, 20 May 2025 14:02:22 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20Quellcode=20aufr=C3=A4umen=20,PoiUt?= =?UTF-8?q?ils.js=20entfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/PoiUtils.js | 53 ------------------------------------- components/pois/PoiUtils.js | 53 ------------------------------------- config/appVersion.js | 2 +- 3 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 components/PoiUtils.js delete mode 100644 components/pois/PoiUtils.js diff --git a/components/PoiUtils.js b/components/PoiUtils.js deleted file mode 100644 index 772bbabdf..000000000 --- a/components/PoiUtils.js +++ /dev/null @@ -1,53 +0,0 @@ -//components/PoiUtils.js -import L from "leaflet"; - -// Funktion, um POI Markers zu erstellen -export const createPoiMarkers = (poiData, iconPath) => { - return poiData.map((location) => { - return L.marker([location.latitude, location.longitude], { - icon: L.icon({ - iconUrl: iconPath, - iconSize: [25, 41], - iconAnchor: [12, 41], - popupAnchor: [1, -34], - draggable: true, - }), - id: location.idPoi, - }); - }); -}; - -// Funktion zum Hinzufügen von Markern zur Karte und zum Umgang mit Events -export const addMarkersToMap = (markers, map, layerGroup) => { - markers.forEach((marker) => { - marker.addTo(layerGroup); - marker.on("mouseover", () => marker.openPopup()); - marker.on("mouseout", () => marker.closePopup()); - marker.on("dragend", (e) => { - console.log("Marker wurde verschoben in addMarkersToMap"); - const newLat = e.target.getLatLng().lat; - const newLng = e.target.getLatLng().lng; - const markerId = e.target.options.id; - updateLocationInDatabase(markerId, newLat, newLng); - }); - }); -}; - -// Funktion zum Aktualisieren der Standorte in der Datenbank -export const updateLocationInDatabase = async (id, newLatitude, newLongitude) => { - const response = await fetch("/api/talas_v5_DB/pois/updateLocation", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - id, - latitude: newLatitude, - longitude: newLongitude, - }), - }); - - if (!response.ok) { - console.error("Fehler beim Aktualisieren der Position"); - } -}; - -// Weitere Funktionen können hier hinzugefügt werden diff --git a/components/pois/PoiUtils.js b/components/pois/PoiUtils.js deleted file mode 100644 index 9275f95f1..000000000 --- a/components/pois/PoiUtils.js +++ /dev/null @@ -1,53 +0,0 @@ -// components/pois/PoiUtils.js -import L from "leaflet"; - -// Funktion, um POI Markers zu erstellen -export const createPoiMarkers = (poiData, iconPath) => { - return poiData.map((location) => { - return L.marker([location.latitude, location.longitude], { - icon: L.icon({ - iconUrl: iconPath, - iconSize: [25, 41], - iconAnchor: [12, 41], - popupAnchor: [1, -34], - draggable: true, - }), - id: location.idPoi, - }); - }); -}; - -// Funktion zum Hinzufügen von Markern zur Karte und zum Umgang mit Events -export const addMarkersToMap = (markers, map, layerGroup) => { - markers.forEach((marker) => { - marker.addTo(layerGroup); - marker.on("mouseover", () => marker.openPopup()); - marker.on("mouseout", () => marker.closePopup()); - marker.on("dragend", (e) => { - console.log("Marker wurde verschoben in addMarkersToMap"); - const newLat = e.target.getLatLng().lat; - const newLng = e.target.getLatLng().lng; - const markerId = e.target.options.id; - updateLocationInDatabase(markerId, newLat, newLng); - }); - }); -}; - -// Funktion zum Aktualisieren der Standorte in der Datenbank -export const updateLocationInDatabase = async (id, newLatitude, newLongitude) => { - const response = await fetch("/api/talas_v5_DB/pois/updateLocation", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - id, - latitude: newLatitude, - longitude: newLongitude, - }), - }); - - if (!response.ok) { - console.error("Fehler beim Aktualisieren der Position"); - } -}; - -// Weitere Funktionen können hier hinzugefügt werden diff --git a/config/appVersion.js b/config/appVersion.js index 80bddb66d..a3a9bd648 100644 --- a/config/appVersion.js +++ b/config/appVersion.js @@ -1,2 +1,2 @@ // /config/appVersion -export const APP_VERSION = "1.1.119"; +export const APP_VERSION = "1.1.120";