From 0e901b609a95763e8dd29e43ab5bd2be39a027aa Mon Sep 17 00:00:00 2001 From: Ismail Ali Date: Sun, 21 Apr 2024 16:23:59 +0200 Subject: [PATCH] Offset in Tooltip for Marker from MySQL --- components/MapComponent.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/MapComponent.js b/components/MapComponent.js index a04a9dec8..9106327bd 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -304,12 +304,13 @@ const MapComponent = ({ locations, onLocationUpdate }) => { id: location.idPoi, }); - marker.bindPopup( - `${location.description || "Unbekannt"}
Type: ${location.idPoiTyp || "N/A"}
Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}` - ); + /* marker.bindPopup( + `
${location.description || "Unbekannt"}
Type: ${location.idPoiTyp || "N/A"}
Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}
`, + { permanent: false, closeButton: true } + ); */ marker.bindTooltip( - `
${location.description}
`, - { permanent: false, direction: "top" } + `
${location.description || "Unbekannt"}
Type: ${location.idPoiTyp || "N/A"}
Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}
`, + { permanent: false, direction: "top", offset: [0, -30] } ); marker.on("dragend", function (e) {