feat: map view with GPS extraction fix
Adds a new Map sidebar entry that plots photos by their EXIF GPS coordinates on a clustered Leaflet map. While wiring this up, the metadata extractor was reading unprefixed GPS keys that never exist in `exiftool -G -j` output AND assumed coordinates were already floats — every photo silently lost its GPS. The new extract_gps helper handles Composite/EXIF group prefixes and parses DMS strings, and lat/lon are stored as first-class indexed columns so the map can query them without parsing exif_json on every request. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -97,6 +97,20 @@ export const photos = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
/** Lightweight list of every photo with GPS coordinates, used by the
|
||||
* Map view. Returns one tiny object per photo (id, lat, lon, taken_at)
|
||||
* rather than the full photo payload — keeps responses small even on
|
||||
* big libraries. */
|
||||
mapPoints: async () => {
|
||||
const response = await api.get('/photos/map')
|
||||
return response.data as Array<{
|
||||
id: string
|
||||
latitude: number
|
||||
longitude: number
|
||||
taken_at: string | null
|
||||
}>
|
||||
},
|
||||
|
||||
update: async (photoId: string, data: {
|
||||
filename?: string
|
||||
rating?: number
|
||||
@@ -410,6 +424,7 @@ export interface LibraryStats {
|
||||
all_photos: number
|
||||
rated: number
|
||||
colored: number
|
||||
with_gps: number
|
||||
duplicates: number
|
||||
discarded: number
|
||||
total_photos: number
|
||||
|
||||
Reference in New Issue
Block a user