feat: Aktualisierung und Rendering von Marker-Icons und GMA-ToolTip-Werten
- Marker-Icons werden dynamisch aktualisiert, ohne dass Blinken oder redundantes Rendering auftritt. - ToolTip-Werte der GMA-Stationen aktualisieren sich in Echtzeit basierend auf neuen Messdaten. - Verbesserte Performance durch gezielte Updates nur bei Datenänderungen.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// /utils/createAndSetDevices.js
|
||||
// /utils/createAndSetDevices.js
|
||||
import circleIcon from "../components/gisPolylines/icons/CircleIcon";
|
||||
import { saveLineData, redrawPolyline } from "./mapUtils";
|
||||
import L from "leaflet";
|
||||
@@ -36,6 +36,8 @@ export const createAndSetDevices = async (systemId, setMarkersFunction, GisSyste
|
||||
const getIdSystemAndAllowValueMap = new Map(GisSystemStatic.map((system) => [system.IdSystem, system.Allow]));
|
||||
|
||||
if (jsonResponse.Points && statusResponse.Statis) {
|
||||
console.log("jsonResponse.Points: ", jsonResponse.Points);
|
||||
console.log("statusResponse.Statis: ", 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);
|
||||
@@ -62,14 +64,7 @@ export const createAndSetDevices = async (systemId, setMarkersFunction, GisSyste
|
||||
});
|
||||
|
||||
// Verwende das `contextmenu`-Ereignis für den Rechtsklick
|
||||
/* marker.on("contextmenu", function (event) {
|
||||
if (event && event.preventDefault) {
|
||||
event.preventDefault(); // Verhindert das Standard-Kontextmenü
|
||||
}
|
||||
disablePolylineEvents(window.polylines);
|
||||
this.openPopup();
|
||||
});
|
||||
*/
|
||||
|
||||
marker.on("contextmenu", function (event) {
|
||||
if (event && event.preventDefault) {
|
||||
event.preventDefault(); // Verhindert das Standard-Kontextmenü
|
||||
@@ -115,16 +110,7 @@ export const createAndSetDevices = async (systemId, setMarkersFunction, GisSyste
|
||||
<div class="mt-2">${statusInfo}</div>
|
||||
</div>
|
||||
`);
|
||||
/* marker.bindPopup(`
|
||||
<div class="bg-white rounded-lg">
|
||||
<span class="text-lg font-semibold text-gray-900">${station.LD_Name}</span>
|
||||
<span class="text-md font-bold text-gray-800"> ${station.Device}</span><br>
|
||||
<span class="text-gray-800"><strong> ${station.Area_Short} </strong>(${station.Area_Name})</span><br>
|
||||
<span class="text-gray-800"><strong>${station.Location_Short} </strong> (${station.Location_Name})</span>
|
||||
<div class="mt-2">${statusInfo}</div>
|
||||
<a href="${station.Link}" target="_blank" style="color: blue;">${BASE_URL}${station.Link}</a>
|
||||
</div>
|
||||
`); */
|
||||
|
||||
|
||||
return marker;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user