/* // hooks/useSiemensMarkersLayer.js
import { useState, useEffect } from "react";
import L from "leaflet";
import { addContextMenuToMarker } from "../../utils/addContextMenuToMarker";
import { createAndSetDevices } from "../../utils/createAndSetDevices";
import { checkOverlappingMarkers } from "../../utils/mapUtils";

const useSiemensMarkersLayer = (map, oms, gisSystemStatic, priorityConfig) => {
  const [siemensMarkers, setSiemensMarkers] = useState([]);

  useEffect(() => {
    if (gisSystemStatic && gisSystemStatic.length && map) {
      createAndSetDevices(8, setSiemensMarkers, gisSystemStatic, priorityConfig); // Siemens-System
    }
  }, [gisSystemStatic, map, priorityConfig]);

  useEffect(() => {
    if (map && siemensMarkers.length) {
      siemensMarkers.forEach((marker) => {
        marker.addTo(map);
        oms.addMarker(marker);

        // Popup on mouseover and mouseout
        marker.on("mouseover", function () {
          this.openPopup();
        });
        marker.on("mouseout", function () {
          this.closePopup();
        });

        addContextMenuToMarker(marker);
      });

      // Disable map context menu
      map.options.contextmenu = false;
      map.options.contextmenuItems = [];

      oms.map.options.contextmenu = false;
      oms.map.options.contextmenuItems = [];

      // Call the function to check for overlapping markers
      checkOverlappingMarkers(oms, map);
    }
  }, [map, siemensMarkers, oms]);

  return siemensMarkers;
};

export default useSiemensMarkersLayer;
 */
