Files
nodeMap/docs/frontend/redux/api/fromWebService/fetchGisStationsMeasurements.md
ISA 04ad5b99e6 docs+refactor: Port-Logik und URL-Handling für Webservices vereinheitlicht
- fetchGisSystemStatic und fetchGisStationsMeasurements nutzen jetzt zentrale .env-Steuerung (NEXT_PUBLIC_API_PORT_MODE)
- feste :3000- oder :80-Zugriffe entfernt, dynamisch via hostname aufgebaut
- URL-Parameter m/u aus der Query übernommen
- zwei neue Dokumentationsdateien im Verzeichnis /docs/frontend/redux/api/fromWebService/
- CHANGELOG.md auf Version 1.1.69 aktualisiert
2025-05-16 13:12:10 +02:00

81 lines
1.9 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.

# 🌐 fetchGisStationsMeasurements Geräte-Messwerte abrufen
## Zweck
Diese Funktion ruft Messwerte aller Geräte einer Karte ab.
Die Daten werden vom Webservice `GisStationsMeasurements` bereitgestellt.
---
## Webservice-Endpunkt
```
GisStationsMeasurements?idMap={idMap}&idUser={idUser}
```
---
## Besonderheit: Port-Steuerung per Umgebungsvariable
Die Webservices (z.B. `WebServiceMap.asmx`) laufen **immer auf Port 80**
auch in der Entwicklungsumgebung.
Um das zu berücksichtigen, wird der Port über `.env.local` gesteuert:
```env
NEXT_PUBLIC_API_PORT_MODE=dev
```
### Beispiel (aus dem Code):
```js
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
const apiBaseUrl =
mode === "dev"
? `${window.location.protocol}//${window.location.hostname}:80/talas5/ClientData/WebServiceMap.asmx`
: `${window.location.origin}/talas5/ClientData/WebServiceMap.asmx`;
```
---
## Parameter
| URL-Parameter | Beschreibung | Übergabe durch TALAS.web |
|---------------|--------------|---------------------------|
| `m` | Map-ID | Ja |
| `u` | User-ID | Ja |
Diese Parameter werden clientseitig aus der URL gelesen:
```js
const params = new URLSearchParams(window.location.search);
const idMap = params.get("m");
const idUser = params.get("u");
```
---
## Beispiel-Aufruf
```
http://10.10.0.13/talas5/MessagesMap/mapTypeC.aspx?m=12&u=484
```
→ ergibt folgenden Webservice-Aufruf:
```
http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisStationsMeasurements?idMap=12&idUser=484
```
---
## Siehe auch
- `.env.local``NEXT_PUBLIC_API_PORT_MODE`
- `docs/frontend/redux/api/fromWebService/fetchGisSystemStatic.md`
- API-Datei: `/redux/api/fromWebService/fetchGisStationsMeasurements.js`
---
📄 Pfad: `/docs/frontend/redux/api/fromWebService/fetchGisStationsMeasurements.md`