Flexibilität: Der Wert für m ist jetzt dynamisch und hängt von der aktuellen URL ab

This commit is contained in:
ISA
2024-12-19 14:24:44 +01:00
parent 3c79a297fd
commit aef5ec216b
2 changed files with 24 additions and 5 deletions

View File

@@ -50,10 +50,19 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
const data = await response.json();
const markers = data.map((item) => {
const marker = L.marker([item.x, item.y], { icon: customIcon }).bindPopup(`
<strong>ID Location:</strong> ${item.idLocation} <br />
<strong>ID Map:</strong> ${item.idMaps}
`);
const marker = L.marker([item.x, item.y], { icon: customIcon });
// Tooltip statt Popup
marker.bindTooltip(
`<strong>ID Location:</strong> ${item.idLocation} <br />
<strong>ID Map:</strong> ${item.idMaps}`,
{
permanent: false, // Tooltip wird nur bei Mouseover angezeigt
direction: "top", // Position des Tooltips relativ zum Marker
offset: [0, -20], // Verschiebung für bessere Sichtbarkeit
}
);
return marker;
});