Files
nodeMap/docs/frontend/redux/api/fromWebService/fetchGisStationsStatic.md
ISA 128b8fea5d docs+refactor: fetchGisStationsStatic API-Aufruf vereinheitlicht
- fetchGisStationsStatic.js verwendet jetzt zentrale Port-Logik über .env.local (NEXT_PUBLIC_API_PORT_MODE)
- Map-ID wird direkt aus der URL gelesen (?m=...)
- Fehlerprüfung auf JSON-Antwort eingebaut
- Doku erstellt: /docs/frontend/redux/api/fromWebService/fetchGisStationsStatic.md
- CHANGELOG.md aktualisiert (v1.1.71)
2025-05-16 13:27:48 +02:00

78 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

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.

# 🌐 fetchGisStationsStatic Standortdaten der Karte abrufen
## Zweck
Diese Funktion ruft die statischen Standortinformationen aller Geräte für eine bestimmte Karte ab.
Sie nutzt den Webservice-Endpunkt `GisStationsStatic`.
---
## Webservice-Endpunkt
```
GisStationsStatic?idMap={idMap}
```
---
## Besonderheit: Port-Steuerung über Umgebungsvariable
Die Webservices laufen immer auf Port 80 auch in der Entwicklungsumgebung.
Die Funktion erkennt dies anhand der Umgebungsvariable in `.env.local`:
```env
NEXT_PUBLIC_API_PORT_MODE=dev
```
### Codeauszug:
```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 |
Die Map-ID wird aus der URL gelesen:
```js
const params = new URLSearchParams(window.location.search);
const idMap = params.get("m");
```
---
## Beispiel
```
http://10.10.0.13/talas5/MessagesMap/mapTypeC.aspx?m=12&u=484
```
→ wird zu:
```
http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisStationsStatic?idMap=12
```
---
## Siehe auch
- `.env.local``NEXT_PUBLIC_API_PORT_MODE`
- `fetchGisSystemStatic.md`
- `fetchGisStationsMeasurements.md`
---
📄 Pfad: `/docs/frontend/redux/api/fromWebService/fetchGisStationsStatic.md`