From 2da00799dd89965738692e098ee928beea2c1f17 Mon Sep 17 00:00:00 2001 From: ISA Date: Tue, 10 Sep 2024 20:55:42 +0200 Subject: [PATCH] =?UTF-8?q?Linien=20Tooltip=20offset=20auf=2020,=20damit?= =?UTF-8?q?=20der=20Cursor=20nicht=20dr=C3=BCber=20steht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MapComponent.js | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/components/MapComponent.js b/components/MapComponent.js index 449f4f12b..1e46307ec 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -498,7 +498,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { }; fetchData(); }, []); - + //-------------------------------------------- //Tooltip an mouse position anzeigen für die Linien useEffect(() => { if (!map) return; @@ -517,7 +517,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { permanent: false, direction: "auto", sticky: true, - offset: [0, 10], + offset: [20, 0], pane: "tooltipPane", }); @@ -561,7 +561,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { setMarkers(newMarkers); setPolylines(newPolylines); }, [map, linePositions, lineColors, tooltipContents, newPoint, newCoords, tempMarker]); - // }, [map, linePositions, lineColors, tooltipContents, newPoint, newCoords, tempMarker]); + //-------------------------------------------- useEffect(() => { @@ -592,6 +592,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { }; } }, [map]); + //-------------------------------------------- useEffect(() => { if (selectedArea && map) { @@ -608,12 +609,6 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { } }, [zoomTrigger, map]); - /* useEffect(() => { - if (mapRef.current && !map) { - initializeMap(mapRef, setMap, setOms, setMenuItemAdded, addItemsToMapContextMenu, hasRights); - } - }, [mapRef, map, hasRights, addItemsToMapContextMenu]); */ - useEffect(() => { if (map && poiLayerRef.current && isPoiTypLoaded && !menuItemAdded && isRightsLoaded) { addItemsToMapContextMenu(map, menuItemAdded, setMenuItemAdded, hasRights, setShowPopup, setPopupCoordinates); @@ -638,18 +633,6 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { fetchPriorityConfig(); }, []); //-------------------------------------------- - /* useEffect(() => { - if (!map) return; - - markers.forEach((marker) => marker.remove()); - polylines.forEach((polyline) => polyline.remove()); - - const { markers: newMarkers, polylines: newPolylines } = setupPolylines(map, linePositions, lineColors, tooltipContents, setNewCoords, tempMarker, currentZoom, currentCenter); - - setMarkers(newMarkers); - setPolylines(newPolylines); - }, [map, linePositions, lineColors, tooltipContents, newPoint, newCoords, tempMarker, currentZoom, currentCenter]); // Ensure currentZoom and currentCenter are included in the dependency array */ - //-------------------------------------------- useEffect(() => { if (mapRef.current && !map) { initializeMap(mapRef, setMap, setOms, setMenuItemAdded, addItemsToMapContextMenu, hasRights, setPolylineEventsDisabled);