Littwin config
This commit is contained in:
@@ -71,8 +71,8 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
const zoomTrigger = useRecoilValue(zoomTriggerState);
|
||||
const offlineTileLayer = "/mapTiles/{z}/{x}/{y}.png";
|
||||
//const onlineTileLayer = "/mapTiles/{z}/{x}/{y}.png";
|
||||
const onlineTileLayer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
||||
//const onlineTileLayer = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Talas_v5 Server
|
||||
//const onlineTileLayer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
||||
const onlineTileLayer = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Talas_v5 Server
|
||||
// Create map layers
|
||||
const TALAS = new L.layerGroup();
|
||||
const ECI = new L.layerGroup();
|
||||
@@ -898,6 +898,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
console.log("poiTypName in poiLayer:", poiTypName);
|
||||
//console.log("location.idPoiTyp poiLayer:", location.idPoiTyp);
|
||||
console.log("location.idPoiTyp poiLayer:", location);
|
||||
console.log("location.idPoiTyp:", location.idPoiTyp);
|
||||
|
||||
const marker = L.marker([latitude, longitude], {
|
||||
icon: L.icon({
|
||||
|
||||
@@ -22,6 +22,7 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
||||
setPoiTypeId(poiData.idPoiTyp);
|
||||
|
||||
setDescription(poiData.description);
|
||||
setDeviceName(poiData.idLD);
|
||||
console.log("Loaded POI Data for editing:", poiData);
|
||||
console.log("POI ID:", poiData.idPoi);
|
||||
console.log("POI Name:", poiData.name);
|
||||
@@ -110,8 +111,9 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
||||
const data = await response.json();
|
||||
//console.log("Standort- und Gerätedaten:", data);
|
||||
setLocationDeviceData(data);
|
||||
if (data.length > 0) {
|
||||
setDeviceName(data[0].name); // Set initial device name
|
||||
if (poiData && poiData.idLD) {
|
||||
const selectedDevice = data.find(device => device.id === poiData.idLD);
|
||||
setDeviceName(selectedDevice ? selectedDevice.id : data[0].id); // Hier wird die ID als initialer Zustand gesetzt
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(
|
||||
@@ -144,7 +146,7 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
||||
name: name,
|
||||
description: description,
|
||||
idPoiTyp: poiTypeId,
|
||||
idLD: idLD,
|
||||
idLD: deviceName,
|
||||
//idLD: parseInt(deviceName, 10), // Konvertieren in eine Ganzzahl
|
||||
}),
|
||||
});
|
||||
@@ -198,7 +200,7 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
||||
className="block p-2 w-full border-2 border-gray-200 rounded-md text-sm"
|
||||
>
|
||||
{locationDeviceData.map((device, index) => (
|
||||
<option key={index} value={device.name}>
|
||||
<option key={index} value={device.id}>
|
||||
{device.name}
|
||||
</option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user