docs
This commit is contained in:
28
docs/utils/addContextMenuToMarker.md
Normal file
28
docs/utils/addContextMenuToMarker.md
Normal file
@@ -0,0 +1,28 @@
|
||||
<!-- /docs/utils/addContextMenuToMarker.md -->
|
||||
|
||||
# 🧭 addContextMenuToMarker.js
|
||||
|
||||
Fügt einem Leaflet-Marker ein individuelles Kontextmenü hinzu.
|
||||
|
||||
## Zweck
|
||||
|
||||
- Erlaubt dem Nutzer über Rechtsklick oder Interaktion den Zugriff auf Funktionen wie:
|
||||
- „Station öffnen (Tab)“
|
||||
- „Details anzeigen“
|
||||
- „Bearbeiten starten“
|
||||
|
||||
## Verwendung
|
||||
|
||||
```js
|
||||
addContextMenuToMarker(marker, idLD, name);
|
||||
```
|
||||
|
||||
## Parameter
|
||||
|
||||
- `marker`: Leaflet-Marker
|
||||
- `idLD`: Geräte-ID
|
||||
- `name`: Anzeigename
|
||||
|
||||
## Kontext
|
||||
|
||||
- Wird z. B. in `createAndSetDevices.js` verwendet
|
||||
14
docs/utils/contextMenuUtils.md
Normal file
14
docs/utils/contextMenuUtils.md
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- /docs/utils/contextMenuUtils.md -->
|
||||
|
||||
# 📋 contextMenuUtils.js
|
||||
|
||||
Hilfsfunktionen zur Verwaltung des Kontextmenüs auf Kartenmarkern und Polylinien.
|
||||
|
||||
## Exportierte Funktionen
|
||||
|
||||
- `getPoiContextMenuOptions(marker)`
|
||||
- `getPolylineContextMenuOptions(line)`
|
||||
|
||||
## Zweck
|
||||
|
||||
- Menüeinträge je nach Zustand und Marker-Art dynamisch generieren
|
||||
14
docs/utils/geometryUtils.md
Normal file
14
docs/utils/geometryUtils.md
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- /docs/utils/geometryUtils.md -->
|
||||
|
||||
# 📐 geometryUtils.js
|
||||
|
||||
Mathematische Funktionen zur Berechnung geometrischer Werte auf der Karte.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- `calculateDistance(latlng1, latlng2)`
|
||||
- `getMidpoint(coords)`
|
||||
|
||||
## Zweck
|
||||
|
||||
- Interne Hilfsfunktionen für Strecken, Tooltip-Positionen etc.
|
||||
15
docs/utils/initializeMap.md
Normal file
15
docs/utils/initializeMap.md
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- /docs/initializeMap.md -->
|
||||
|
||||
# 🗺️ initializeMap.js
|
||||
|
||||
Initialisiert die Leaflet-Karte mit Basislayern, Gruppen und globalen Events.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- `initializeMap(mapElementId)`
|
||||
|
||||
## Verhalten
|
||||
|
||||
- Erstellt LayerGroups (Devices, POIs, Linien)
|
||||
- Bindet Kontextmenü
|
||||
- Stellt Default-Zoom und Position ein
|
||||
10
docs/utils/mapUtils.md
Normal file
10
docs/utils/mapUtils.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- /docs/utils/mapUtils.md -->
|
||||
|
||||
# 🧰 mapUtils.js
|
||||
|
||||
Allgemeine Hilfsfunktionen für Leaflet (z. B. Zoom, Marker-Checks, Layer-Findung).
|
||||
|
||||
## Funktionen
|
||||
|
||||
- `zoomToBounds(layerGroup)`
|
||||
- `findLayerById(map, id)`
|
||||
14
docs/utils/markerUtils.md
Normal file
14
docs/utils/markerUtils.md
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- /docs/utils/markerUtils.md -->
|
||||
|
||||
# 📍 markerUtils.js
|
||||
|
||||
Hilfsfunktionen zur Erstellung und Konfiguration von Leaflet-Markern.
|
||||
|
||||
## Exportierte Funktionen
|
||||
|
||||
- `createIconByType(type)`
|
||||
- `createMarker(position, icon)`
|
||||
|
||||
## Kontext
|
||||
|
||||
- Wird in `setupDevices.js` und `setupPOIs.js` verwendet
|
||||
16
docs/utils/mysqlPool.md
Normal file
16
docs/utils/mysqlPool.md
Normal file
@@ -0,0 +1,16 @@
|
||||
<!-- /docs/utils/mysqlPool.md -->
|
||||
|
||||
# 💾 mysqlPool.js
|
||||
|
||||
MySQL-Verbindungspool für effiziente Datenbankabfragen (z. B. mit `promise-mysql`).
|
||||
|
||||
## Verwendung
|
||||
|
||||
```js
|
||||
const connection = await pool.getConnection();
|
||||
```
|
||||
|
||||
## Zweck
|
||||
|
||||
- Reuse von Verbindungen
|
||||
- Fehlervermeidung bei vielen gleichzeitigen Abfragen
|
||||
15
docs/utils/openInNewTab.md
Normal file
15
docs/utils/openInNewTab.md
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- /docs/utils/openInNewTab.md -->
|
||||
|
||||
# 🪟 openInNewTab.js
|
||||
|
||||
Öffnet eine URL in einem neuen Tab und schützt vor Referrer-Leaks.
|
||||
|
||||
## Verwendung
|
||||
|
||||
```js
|
||||
openInNewTab(url);
|
||||
```
|
||||
|
||||
## Intern
|
||||
|
||||
- nutzt `window.open` mit `noopener,noreferrer`
|
||||
15
docs/utils/openInSameWindow.md
Normal file
15
docs/utils/openInSameWindow.md
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- /docs/utils/openInSameWindow.md -->
|
||||
|
||||
# 🚪 openInSameWindow.js
|
||||
|
||||
Öffnet eine URL im aktuellen Tab.
|
||||
|
||||
## Verwendung
|
||||
|
||||
```js
|
||||
openInSameWindow("/target");
|
||||
```
|
||||
|
||||
## Verhalten
|
||||
|
||||
- `window.location.href = url`
|
||||
14
docs/utils/poiUtils.md
Normal file
14
docs/utils/poiUtils.md
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- /docs/utils/poiUtils.md -->
|
||||
|
||||
# 🧭 poiUtils.js
|
||||
|
||||
Hilfsfunktionen zur Handhabung von POIs (z. B. Icons, Typzuordnung, Interaktion).
|
||||
|
||||
## Funktionen
|
||||
|
||||
- `getIconForPoiType(type)`
|
||||
- `groupPOIsByType(list)`
|
||||
|
||||
## Verwendung
|
||||
|
||||
- In `setupPOIs.js` und Thunks für POI-Handling
|
||||
10
docs/utils/polylines/contextMenu.md
Normal file
10
docs/utils/polylines/contextMenu.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- /docs/utils/polylines/contextMenu.md -->
|
||||
|
||||
# 📋 contextMenu.js
|
||||
|
||||
Funktionen zum Steuern des Polyline-Kontextmenüs (Schließen, Zurücksetzen, etc.).
|
||||
|
||||
## exportierte Funktionen
|
||||
|
||||
- `closePolylineSelectionAndContextMenu(map)`: Setzt Polyline-Auswahl zurück und schließt das Kontextmenü
|
||||
- `monitorContextMenu(map)`: Überwacht via `localStorage`, ob das Menü automatisch geschlossen werden soll
|
||||
10
docs/utils/polylines/eventHandlers.md
Normal file
10
docs/utils/polylines/eventHandlers.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- /docs/utils/polylines/eventHandlers.md -->
|
||||
|
||||
# 🖱️ eventHandlers.js
|
||||
|
||||
Bindet Maus-Events an Polylinien (z. B. Hover-Effekte).
|
||||
|
||||
## exportierte Funktionen
|
||||
|
||||
- `enablePolylineEvents(polylines, lineColors)`
|
||||
- `disablePolylineEvents(polylines)`
|
||||
10
docs/utils/polylines/monitorContextMenu.md
Normal file
10
docs/utils/polylines/monitorContextMenu.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- /docs/utils/polylines/monitorContextMenu.md -->
|
||||
|
||||
# 🔄 monitorContextMenu.js
|
||||
|
||||
Erweiterte Überwachung des Kontextmenüs über `localStorage`.
|
||||
|
||||
## Funktion
|
||||
|
||||
- Importiert `closePolylineSelectionAndContextMenu`
|
||||
- Ruft regelmäßig `setTimeout` auf, um `contextMenuExpired` zu prüfen
|
||||
10
docs/utils/polylines/polylineSubscription.md
Normal file
10
docs/utils/polylines/polylineSubscription.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- /docs/utils/polylines/polylineSubscription.md -->
|
||||
|
||||
# 🧭 polylineSubscription.js
|
||||
|
||||
Abonnement auf den Redux-Store, um auf `forceClose` im Kontextmenü zu reagieren.
|
||||
|
||||
## Verhalten
|
||||
|
||||
- Erkennt `polylineContextMenu.forceClose`
|
||||
- Ruft `contextmenu.hide()` auf und resetet Redux-Status
|
||||
14
docs/utils/polylines/redrawPolyline.md
Normal file
14
docs/utils/polylines/redrawPolyline.md
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- /docs/utils/polylines/redrawPolyline.md -->
|
||||
|
||||
# 🔁 redrawPolyline.js
|
||||
|
||||
Zeichnet eine Polyline mit neuen Koordinaten und Tooltip neu.
|
||||
|
||||
## Funktion
|
||||
|
||||
```js
|
||||
redrawPolyline(lineData, lineColors, tooltipContents, map)
|
||||
```
|
||||
|
||||
- Entfernt vorherige Polyline
|
||||
- Erstellt neue mit Tooltip und Hover-Effekten
|
||||
@@ -1,3 +1,5 @@
|
||||
<!-- /docs/utils/polylines/setupPolylines.md -->
|
||||
|
||||
# 🧭 setupPolylines.js – Polylinien zeichnen und verwalten
|
||||
|
||||
## Zweck
|
||||
@@ -38,10 +40,7 @@ NEXT_PUBLIC_API_PORT_MODE=dev
|
||||
```js
|
||||
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
||||
|
||||
const baseUrl =
|
||||
mode === "dev"
|
||||
? `${window.location.protocol}//${window.location.hostname}:80/talas5/`
|
||||
: `${window.location.origin}/talas5/`;
|
||||
const baseUrl = mode === "dev" ? `${window.location.protocol}//${window.location.hostname}:80/talas5/` : `${window.location.origin}/talas5/`;
|
||||
```
|
||||
|
||||
---
|
||||
@@ -74,4 +73,4 @@ const baseUrl =
|
||||
|
||||
---
|
||||
|
||||
📄 Pfad: `/docs/frontend/utils/polylines/setupPolylines.md`
|
||||
📄 Pfad: `/docs/frontend/utils/polylines/setupPolylines.md`
|
||||
|
||||
15
docs/utils/setupDevices.md
Normal file
15
docs/utils/setupDevices.md
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- /docs/setupDevices.md -->
|
||||
|
||||
# 🔌 setupDevices.js
|
||||
|
||||
Fügt alle Geräte (Devices) zur Karte hinzu.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- `setupDevices(map, deviceList)`
|
||||
|
||||
## Verhalten
|
||||
|
||||
- Marker-Erstellung
|
||||
- Eventbindung
|
||||
- Layer-Zuweisung
|
||||
@@ -1,3 +1,5 @@
|
||||
<!-- /docs/utils/setupPOIs.md -->
|
||||
|
||||
# 🧭 `setupPOIs.js`
|
||||
|
||||
## Zweck
|
||||
|
||||
10
docs/utils/zoomAndCenterUtils.md
Normal file
10
docs/utils/zoomAndCenterUtils.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- /docs/utils/zoomAndCenterUtils.md -->
|
||||
|
||||
# 🔍 zoomAndCenterUtils.js
|
||||
|
||||
Hilfsfunktionen zum Zoomen auf Marker oder Linien.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- `zoomToMarker(map, marker)`
|
||||
- `centerOnCoordinates(map, coords)`
|
||||
Reference in New Issue
Block a user