1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

Update nginx migration documentation and enhance AdventureModal component functionality

This commit is contained in:
Sean Morley 2024-11-08 17:15:53 -05:00
parent efd19da10b
commit 6132b1c0d6
2 changed files with 9 additions and 15 deletions

View file

@ -17,7 +17,7 @@
export let latitude: number | null = null;
export let collection: Collection | null = null;
import { DefaultMarker, MapEvents, MapLibre } from 'svelte-maplibre';
import { DefaultMarker, FillLayer, MapEvents, MapLibre } from 'svelte-maplibre';
let query: string = '';
let places: OpenStreetMapPlace[] = [];
@ -89,7 +89,7 @@
if (longitude && latitude) {
adventure.latitude = latitude;
adventure.longitude = longitude;
reverseGeocode();
reverseGeocode(true);
}
$: {
@ -120,16 +120,6 @@
markers = [];
}
// $: {
// if (
// reverseGeocodePlace?.display_name &&
// (old_display_name != reverseGeocodePlace.display_name || !adventure.location)
// ) {
// adventure.location = reverseGeocodePlace.display_name;
// old_display_name = reverseGeocodePlace.display_name;
// }
// }
let imageSearch: string = adventure.name || '';
async function removeImage(id: string) {
@ -298,7 +288,7 @@
}
}
async function reverseGeocode() {
async function reverseGeocode(force_update: boolean = false) {
let res = await fetch(
`/api/reverse-geocode/reverse_geocode/?lat=${adventure.latitude}&lon=${adventure.longitude}`
);
@ -310,7 +300,11 @@
}
reverseGeocodePlace = data;
if (reverseGeocodePlace && reverseGeocodePlace.display_name && !is_custom_location) {
if (
reverseGeocodePlace &&
reverseGeocodePlace.display_name &&
(!is_custom_location || force_update)
) {
old_display_name = reverseGeocodePlace.display_name;
adventure.location = reverseGeocodePlace.display_name;
}