mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 14:21:46 +00:00
Merge pull request #636 from mauriceboe/fix/session-14042026
Fix journey map OSM warning, sidebar re-render & migration 98 ambiguous column
This commit is contained in:
@@ -155,7 +155,7 @@ const JourneyMap = forwardRef<JourneyMapHandle, Props>(function JourneyMap(
|
|||||||
|
|
||||||
const map = L.map(containerRef.current, {
|
const map = L.map(containerRef.current, {
|
||||||
zoomControl: false,
|
zoomControl: false,
|
||||||
attributionControl: false,
|
attributionControl: true,
|
||||||
scrollWheelZoom: false,
|
scrollWheelZoom: false,
|
||||||
dragging: true,
|
dragging: true,
|
||||||
touchZoom: true,
|
touchZoom: true,
|
||||||
@@ -165,7 +165,10 @@ const JourneyMap = forwardRef<JourneyMapHandle, Props>(function JourneyMap(
|
|||||||
const defaultTile = dark
|
const defaultTile = dark
|
||||||
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
|
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
|
||||||
: 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png'
|
: 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png'
|
||||||
L.tileLayer(mapTileUrl || defaultTile, { maxZoom: 18 }).addTo(map)
|
L.tileLayer(mapTileUrl || defaultTile, {
|
||||||
|
maxZoom: 18,
|
||||||
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
||||||
|
}).addTo(map)
|
||||||
|
|
||||||
const items = buildMarkerItems(entries)
|
const items = buildMarkerItems(entries)
|
||||||
itemsRef.current = items
|
itemsRef.current = items
|
||||||
|
|||||||
@@ -158,6 +158,16 @@ export default function JourneyDetailPage() {
|
|||||||
[current?.entries]
|
[current?.entries]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const sidebarMapItems = useMemo(() => mapEntries.map(e => ({
|
||||||
|
id: String(e.id),
|
||||||
|
lat: e.location_lat!,
|
||||||
|
lng: e.location_lng!,
|
||||||
|
title: e.title || '',
|
||||||
|
mood: e.mood,
|
||||||
|
created_at: e.entry_date,
|
||||||
|
entry_date: e.entry_date,
|
||||||
|
})), [mapEntries])
|
||||||
|
|
||||||
const tripDates = useMemo(() => {
|
const tripDates = useMemo(() => {
|
||||||
const dates = new Set<string>()
|
const dates = new Set<string>()
|
||||||
if (!current?.trips) return dates
|
if (!current?.trips) return dates
|
||||||
@@ -387,17 +397,9 @@ export default function JourneyDetailPage() {
|
|||||||
<JourneyMap
|
<JourneyMap
|
||||||
ref={mapRef}
|
ref={mapRef}
|
||||||
checkins={[]}
|
checkins={[]}
|
||||||
entries={mapEntries.map(e => ({
|
entries={sidebarMapItems as any}
|
||||||
id: String(e.id),
|
|
||||||
lat: e.location_lat!,
|
|
||||||
lng: e.location_lng!,
|
|
||||||
title: e.title || '',
|
|
||||||
mood: e.mood,
|
|
||||||
created_at: e.entry_date,
|
|
||||||
entry_date: e.entry_date,
|
|
||||||
})) as any}
|
|
||||||
height={240}
|
height={240}
|
||||||
onMarkerClick={(id) => handleMarkerClick(id)}
|
onMarkerClick={handleMarkerClick}
|
||||||
/>
|
/>
|
||||||
<div className="px-3.5 py-2.5 border-t border-zinc-200 dark:border-zinc-700 flex items-center justify-between text-[11px] text-zinc-500">
|
<div className="px-3.5 py-2.5 border-t border-zinc-200 dark:border-zinc-700 flex items-center justify-between text-[11px] text-zinc-500">
|
||||||
<span>{mapEntries.length} {t('journey.stats.places')}</span>
|
<span>{mapEntries.length} {t('journey.stats.places')}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user