Linien Tooltip offset auf 20, damit der Cursor nicht drüber steht

This commit is contained in:
ISA
2024-09-10 20:55:42 +02:00
parent 6167cbe5b2
commit 2da00799dd

View File

@@ -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);