edit: baseUrl in MapComponent.js
This commit is contained in:
@@ -167,27 +167,8 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const lineLayer = new L.LayerGroup();
|
||||
|
||||
const [gisSystemStaticLoaded, setGisSystemStaticLoaded] = useState(false);
|
||||
const [baseUrl, setBaseUrl] = useState("");
|
||||
useEffect(() => {
|
||||
fetch("/api/get-talasIP")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const ip = data.ip;
|
||||
if (ip) {
|
||||
// Erstellen Sie die Basis-URL mit der erhaltenen IP
|
||||
const newBaseUrl = `http://${ip}/talas5/devices/`;
|
||||
setBaseUrl(newBaseUrl);
|
||||
console.log("Base URL set to:", newBaseUrl);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error fetching IP:", error);
|
||||
// Hier können Sie einen Fallback einstellen, falls die IP-Abfrage fehlschlägt
|
||||
setBaseUrl("http://default-ip/talas5/devices/");
|
||||
});
|
||||
}, []);
|
||||
|
||||
//const baseUrl = "http://10.10.0.13/talas5/devices/"; // für Station öffnen in neuer tab und gleicher tab, im localhost gab es keine Probleme mit der Frame
|
||||
const baseUrl = "http://10.10.0.13/talas5/devices/"; // für Station öffnen in neuer tab und gleicher tab, im localhost gab es keine Probleme mit der Frame
|
||||
//const baseUrl = "http://localhost/talas5/devices/";
|
||||
const [isPoiTypLoaded, setIsPoiTypLoaded] = useState(false);
|
||||
const [poiTypMap, setPoiTypMap] = useState(new Map());
|
||||
|
||||
Reference in New Issue
Block a user