feat: Healthcheck um Webservices, API-Routen und .env-Prüfungen erweitert
- Externe Webservices von TALAS V5 integriert und geprüft (Statuscode + Antwortstruktur) - Eigene API-Endpunkte wie /api/talas_v5_DB/getDevices hinzugefügt und validiert - Prüfung von NEXT_PUBLIC_USE_MOCKS zur Vermeidung von Mockdaten in Produktion - Validierung der Umgebungsvariablen wie DB_HOST, DB_NAME und NODE_ENV ergänzt - Response-Status 200 bei vollständigem Erfolg, 207 bei Teilfehlern - Verbesserung der JSON-Antwortstruktur zur einfacheren Analyse
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import L from "leaflet";
|
||||
|
||||
// Call this function on page load to restore zoom and center
|
||||
export const restoreMapSettings = (map) => {
|
||||
export const restoreMapSettings = map => {
|
||||
const savedZoom = localStorage.getItem("mapZoom");
|
||||
const savedCenter = localStorage.getItem("mapCenter");
|
||||
|
||||
@@ -29,7 +29,7 @@ export const checkOverlappingMarkers = (map, markers, plusIcon, oms) => {
|
||||
|
||||
const overlappingGroups = {};
|
||||
|
||||
markers.forEach((marker) => {
|
||||
markers.forEach(marker => {
|
||||
if (map.hasLayer(marker)) {
|
||||
const latlngStr = marker.getLatLng().toString();
|
||||
if (overlappingGroups[latlngStr]) {
|
||||
@@ -40,7 +40,7 @@ export const checkOverlappingMarkers = (map, markers, plusIcon, oms) => {
|
||||
}
|
||||
});
|
||||
|
||||
plusMarkers.forEach((plusMarker) => map.removeLayer(plusMarker));
|
||||
plusMarkers.forEach(plusMarker => map.removeLayer(plusMarker));
|
||||
plusMarkers = [];
|
||||
|
||||
for (const coords in overlappingGroups) {
|
||||
@@ -62,18 +62,26 @@ export const checkOverlappingMarkers = (map, markers, plusIcon, oms) => {
|
||||
|
||||
export const handlePlusIconClick = (map, markers, oms, clickedLatLng) => {
|
||||
// Debugging-Ausgabe
|
||||
console.log("Plus-Icon Position:", clickedLatLng);
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
console.log("Plus-Icon Position:", clickedLatLng);
|
||||
}
|
||||
|
||||
// Finde Marker in der Nähe der Klickposition
|
||||
const nearbyMarkers = markers.filter((marker) => map.distance(marker.getLatLng(), clickedLatLng) < 50);
|
||||
const nearbyMarkers = markers.filter(
|
||||
marker => map.distance(marker.getLatLng(), clickedLatLng) < 50
|
||||
);
|
||||
|
||||
// Debugging-Ausgabe
|
||||
console.log("Gefundene Marker in der Nähe:", nearbyMarkers);
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
console.log("Gefundene Marker in der Nähe:", nearbyMarkers);
|
||||
}
|
||||
|
||||
if (oms && nearbyMarkers.length > 0) {
|
||||
// Spiderfy die gefundenen Marker
|
||||
oms.spiderfy(nearbyMarkers);
|
||||
} else {
|
||||
console.log("Keine überlappenden Marker gefunden.");
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
console.log("Keine überlappenden Marker gefunden.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user