1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-17 03:47:45 +02:00

feat(server): reverse geocoding endpoint (#11430)

* feat(server): reverse geocoding endpoint

* chore: rename error message
This commit is contained in:
Jason Rasmussen
2024-07-29 18:17:26 -04:00
committed by GitHub
parent a70cd368af
commit ebc71e428d
12 changed files with 443 additions and 42 deletions

View File

@ -554,6 +554,11 @@ export type MapMarkerResponseDto = {
lon: number;
state: string | null;
};
export type MapReverseGeocodeResponseDto = {
city: string | null;
country: string | null;
state: string | null;
};
export type OnThisDayDto = {
year: number;
};
@ -1991,6 +1996,20 @@ export function getMapMarkers({ fileCreatedAfter, fileCreatedBefore, isArchived,
...opts
}));
}
export function reverseGeocode({ lat, lon }: {
lat: number;
lon: number;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: MapReverseGeocodeResponseDto[];
}>(`/map/reverse-geocode${QS.query(QS.explode({
lat,
lon
}))}`, {
...opts
}));
}
export function getMapStyle({ key, theme }: {
key?: string;
theme: MapTheme;