mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Fly a looked-up place by its coordinates alone, and adopt the bar's files
A place row sent its name with its coordinates, and a name that matches a city preset wins over them: "Paris, Texas" flew to Paris, France. Only the coordinates go now. The bar's styles and dock tests join the format scope and the bar its package. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
a3f4af91f8
commit
24731951a0
3 files changed
+32
-7
No files matched your search
@@ -372,9 +372,13 @@ const strip = computed(() => {
|
||||
return all.length ? { title, chips: all } : null;
|
||||
});
|
||||
|
||||
/** Fly to a place by its coordinates, as a looked-up place row does. */
|
||||
async function goTo({ name, latitude, longitude }) {
|
||||
if (runner.value) return settled(await runner.value('fly_to_location', { latitude, longitude, query: name }));
|
||||
/**
|
||||
* Fly to a place by its coordinates, as a looked-up place row does. Only the
|
||||
* coordinates go: with its name, "Paris, Texas" would fly to the city
|
||||
* preset Paris.
|
||||
*/
|
||||
async function goTo({ latitude, longitude }) {
|
||||
if (runner.value) return settled(await runner.value('fly_to_location', { latitude, longitude }));
|
||||
const location = locationStore.controls;
|
||||
if (!location || location.destroyed) throw new Error();
|
||||
await location.search(`${latitude}, ${longitude}`);
|
||||
@@ -820,7 +824,8 @@ async function choose(item, { viaKey = false } = {}) {
|
||||
else if (item.kind === 'count-show' || item.kind === 'place') {
|
||||
const { coords, place } = item;
|
||||
if (coords && runner.value) {
|
||||
if (!settled(await runner.value('fly_to_location', { ...coords, query: place }))) return;
|
||||
// The coordinates alone: a name would win over them (see goTo).
|
||||
if (!settled(await runner.value('fly_to_location', { ...coords }))) return;
|
||||
} else {
|
||||
const location = locationStore.controls;
|
||||
if (!location || location.destroyed) throw new Error();
|
||||
|
||||
Reference in new issue
Block a user