💄 Trip: display time on marker dot

This commit is contained in:
itskovacs 2025-08-19 19:34:36 +02:00
parent 00e4ef2826
commit 89bbf3766c
2 changed files with 6 additions and 1 deletions

View File

@ -500,6 +500,7 @@ export class TripComponent implements AfterViewInit {
text: this.selectedItem?.text || "",
lat: lat,
lng: lng,
time: this.selectedItem?.time || "",
};
this.tripMapTemporaryMarker = tripDayMarker(item).addTo(this.map!);
this.map?.fitBounds([[lat, lng]], { padding: [60, 60] });
@ -563,6 +564,7 @@ export class TripComponent implements AfterViewInit {
text: item.text,
isPlace: !!item.place,
idx: idx,
time: item.time,
};
if (item.lat && item.lng)
@ -684,6 +686,7 @@ export class TripComponent implements AfterViewInit {
lat: item.lat,
lng: item.lng,
isPlace: !!item.place,
time: item.time,
};
if (item.place && item.place)
return {
@ -691,6 +694,7 @@ export class TripComponent implements AfterViewInit {
lat: item.place.lat,
lng: item.place.lng,
isPlace: true,
time: item.time,
};
return undefined;
})

View File

@ -72,6 +72,7 @@ export function tripDayMarker(item: {
text: string;
lat: number;
lng: number;
time?: string;
}): L.Marker {
const marker = new L.Marker([item.lat!, item.lng], {
icon: L.divIcon({
@ -83,7 +84,7 @@ export function tripDayMarker(item: {
const touchDevice = "ontouchstart" in window;
if (!touchDevice) {
marker.bindTooltip(
`<div class="font-semibold mb-1 truncate text-base">${item.text}</div>`,
`<div class="text-xs text-gray-500">${item.time}</div><div class="font-semibold mb-1 truncate text-base">${item.text}</div>`,
{
direction: "right",
offset: [10, 0],