💄 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 || "",
|
text: this.selectedItem?.text || "",
|
||||||
lat: lat,
|
lat: lat,
|
||||||
lng: lng,
|
lng: lng,
|
||||||
|
time: this.selectedItem?.time || "",
|
||||||
};
|
};
|
||||||
this.tripMapTemporaryMarker = tripDayMarker(item).addTo(this.map!);
|
this.tripMapTemporaryMarker = tripDayMarker(item).addTo(this.map!);
|
||||||
this.map?.fitBounds([[lat, lng]], { padding: [60, 60] });
|
this.map?.fitBounds([[lat, lng]], { padding: [60, 60] });
|
||||||
@ -563,6 +564,7 @@ export class TripComponent implements AfterViewInit {
|
|||||||
text: item.text,
|
text: item.text,
|
||||||
isPlace: !!item.place,
|
isPlace: !!item.place,
|
||||||
idx: idx,
|
idx: idx,
|
||||||
|
time: item.time,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (item.lat && item.lng)
|
if (item.lat && item.lng)
|
||||||
@ -684,6 +686,7 @@ export class TripComponent implements AfterViewInit {
|
|||||||
lat: item.lat,
|
lat: item.lat,
|
||||||
lng: item.lng,
|
lng: item.lng,
|
||||||
isPlace: !!item.place,
|
isPlace: !!item.place,
|
||||||
|
time: item.time,
|
||||||
};
|
};
|
||||||
if (item.place && item.place)
|
if (item.place && item.place)
|
||||||
return {
|
return {
|
||||||
@ -691,6 +694,7 @@ export class TripComponent implements AfterViewInit {
|
|||||||
lat: item.place.lat,
|
lat: item.place.lat,
|
||||||
lng: item.place.lng,
|
lng: item.place.lng,
|
||||||
isPlace: true,
|
isPlace: true,
|
||||||
|
time: item.time,
|
||||||
};
|
};
|
||||||
return undefined;
|
return undefined;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -72,6 +72,7 @@ export function tripDayMarker(item: {
|
|||||||
text: string;
|
text: string;
|
||||||
lat: number;
|
lat: number;
|
||||||
lng: number;
|
lng: number;
|
||||||
|
time?: string;
|
||||||
}): L.Marker {
|
}): L.Marker {
|
||||||
const marker = new L.Marker([item.lat!, item.lng], {
|
const marker = new L.Marker([item.lat!, item.lng], {
|
||||||
icon: L.divIcon({
|
icon: L.divIcon({
|
||||||
@ -83,7 +84,7 @@ export function tripDayMarker(item: {
|
|||||||
const touchDevice = "ontouchstart" in window;
|
const touchDevice = "ontouchstart" in window;
|
||||||
if (!touchDevice) {
|
if (!touchDevice) {
|
||||||
marker.bindTooltip(
|
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",
|
direction: "right",
|
||||||
offset: [10, 0],
|
offset: [10, 0],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user