Offset in Tooltip for Marker from MySQL

This commit is contained in:
2024-04-21 16:23:59 +02:00
parent 63a2c7a611
commit 0e901b609a

View File

@@ -304,12 +304,13 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
id: location.idPoi,
});
marker.bindPopup(
`<b>${location.description || "Unbekannt"}</b><br>Type: ${location.idPoiTyp || "N/A"}<br>Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}`
);
/* marker.bindPopup(
`<div class="bg-red-500 text-red p-2 translate-y-8"><b>${location.description || "Unbekannt"}</b><br>Type: ${location.idPoiTyp || "N/A"}<br>Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}</div>`,
{ permanent: false, closeButton: true }
); */
marker.bindTooltip(
`<div class="bg-white text-black p-2 border border-gray-300 rounded shadow">${location.description}</div>`,
{ permanent: false, direction: "top" }
`<div class=" text-red p-2 "><b>${location.description || "Unbekannt"}</b><br>Type: ${location.idPoiTyp || "N/A"}<br>Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}</div>`,
{ permanent: false, direction: "top", offset: [0, -30] }
);
marker.on("dragend", function (e) {