💄 Trip: display time on marker dot
This commit is contained in:
parent
00e4ef2826
commit
89bbf3766c
@ -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;
|
||||
})
|
||||
|
||||
@ -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],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user