Files
nodeMap/docs/components/MapComponent.md
ISA b847b5d2c8 docs: Projektstruktur der Dokumentation an Quellcode angepasst
- Verzeichnisstruktur unter /docs spiegelt nun die tatsächliche Projektstruktur wider
- frontend/server-Trennung entfernt zugunsten von /docs/pages, /docs/redux, /docs/utils etc.
- Erhöht Wiederauffindbarkeit, Übersichtlichkeit und Entwicklerfreundlichkeit
2025-05-27 09:30:40 +02:00

61 lines
1.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 🗺️ MapComponent Webservice-Parameter
## 🔄 URL-Parameter vom Aufrufer (z.B. TALAS.web)
Die Anwendung wird mit Kurzparametern aufgerufen:
```
http://[SERVER]:3000/?m=12&u=484
```
| Parameter | Bedeutung |
| --------- | -------------------------- |
| `m` | Map-ID (intern: `idMap`) |
| `u` | User-ID (intern: `idUser`) |
Diese Parameter werden im Code wie folgt gelesen:
```js
const params = new URLSearchParams(window.location.search);
const idMap = params.get("m");
const idUser = params.get("u");
```
---
## 🔁 Webservice-Proxy intern
Die Next.js API-Routen übernehmen die Umwandlung zu den Webservices:
```js
// Beispiel: /pages/api/gisSystemStatic.js
const targetUrl = `http://.../WebServiceMap.asmx/GisSystemStatic?idMap=${idMap}&idUser=${idUser}`;
```
➡ Die Konvertierung `m → idMap` und `u → idUser` erfolgt **nur im Backend (API-Routen)**
---
## 🧠 Hinweis für Entwickler
- `m` und `u` **immer** aus der URL im Client lesen
- Niemals `idMap` oder `idUser` direkt im Frontend erwarten
- Alle Webservice-Zugriffe im Frontend laufen über interne API-Routen `/api/...`
- Beispiel-Aufruf:
```js
fetch(`/api/gisSystemStatic?m=${idMap}&u=${idUser}`);
```
---
## 🌐 Beispiele aus der Praxis
| Umgebung | URL-Aufruf-Beispiel |
| --------------------- | ------------------------------------------------------------- |
| Entwicklungs-PC | http://10.10.0.70:3000/?m=12&u=484 |
| Test-Server via TALAS | http://10.10.0.13/talas5/MessagesMap/mapTypeC.aspx?m=12&u=484 |
---
Diese Konvention ist essenziell für einheitliche Übergabe und Backend-Kompatibilität.