diff --git a/config/appVersion.js b/config/appVersion.js index a919491d5..ade980e00 100644 --- a/config/appVersion.js +++ b/config/appVersion.js @@ -1,2 +1,2 @@ // /config/appVersion -export const APP_VERSION = "1.1.140"; +export const APP_VERSION = "1.1.141"; diff --git a/utils/utils.js b/utils/utils.js index e7ca14388..8b6ba4389 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -18,72 +18,7 @@ export const determinePriority = (iconPath) => { return 5; // Default priority (lowest) }; //---------------------------------------------- -export const createAndSetMarkers = async (systemId, setMarkersFunction) => { - try { - const response1 = await fetch(config.mapGisStationsStaticDistrictUrl); - const jsonResponse = await response1.json(); - const response2 = await fetch(config.mapGisStationsStatusDistrictUrl); - const statusResponse = await response2.json(); - const getIdSystemAndAllowValueMap = new Map(GisSystemStatic.map((system) => [system.IdSystem, system.Allow])); - //console.log("getIdSystemAndAllowValueMap:", getIdSystemAndAllowValueMap); - - if (jsonResponse.Points && statusResponse.Statis) { - const statisMap = new Map(statusResponse.Statis.map((s) => [s.IdLD, s])); - let markersData = jsonResponse.Points.filter((station) => station.System === systemId && getIdSystemAndAllowValueMap.get(station.System) === 1).map((station) => { - const statis = statisMap.get(station.IdLD); - const iconPath = statis ? `img/icons/${statis.Na}-marker-icon-${station.Icon}.png` : `img/icons/marker-icon-${station.Icon}.png`; - - const priority = determinePriority(iconPath); - const zIndexOffset = 100 * (5 - priority); // Adjusted for simplicity and positive values - - const marker = L.marker([station.X, station.Y], { - icon: L.icon({ - iconUrl: iconPath, - iconSize: [25, 41], - iconAnchor: [12, 41], - popupAnchor: [1, -34], - }), - areaName: station.Area_Name, // Stelle sicher, dass dieser Bereich gesetzt wird - link: station.Link, - zIndexOffset: zIndexOffset, - bounceOnAdd: !!statis, - }); - - if (statis) { - marker.on("add", () => marker.bounce(3)); - } - - const statusInfo = statusResponse.Statis.filter((status) => status.IdLD === station.IdLD) - .reverse() - .map( - (status) => ` -
-
- ${status.Me} (${status.Na}) -
- ` - ) - .join(""); - - marker.bindPopup(` -
- test zum löschen ${station.LD_Name} - ${station.Device}
- ${station.Area_Short} (${station.Area_Name})
- ${station.Location_Short} (${station.Location_Name}) -
${statusInfo}
-
- `); - return marker; - }); - - setMarkersFunction(markersData); - } - } catch (error) { - console.error("Error fetching data in utils/utils.js : ", error); - } -}; //---------------------------------------------- export const fetchPriorityConfig = async () => { try {