UX: searching will unlock the GPS and cancel 'move to gps' if still waiting for a fix

This commit is contained in:
Pieter Vander Vennet 2024-02-03 14:48:32 +01:00
parent e3dec8aafa
commit aea9aeec21
3 changed files with 7 additions and 0 deletions

View file

@ -11,11 +11,13 @@
import { placeholder } from "../../Utils/placeholder"
import { SearchIcon } from "@rgossiaux/svelte-heroicons/solid"
import { ariaLabel } from "../../Utils/ariaLabel"
import { GeoLocationState } from "../../Logic/State/GeoLocationState"
export let perLayer: ReadonlyMap<string, GeoIndexedStoreForLayer> | undefined = undefined
export let bounds: UIEventSource<BBox>
export let selectedElement: UIEventSource<Feature> | undefined = undefined
export let geolocationState: GeoLocationState | undefined = undefined
export let clearAfterView: boolean = true
let searchContents: string = ""
export let triggerSearch: UIEventSource<any> = new UIEventSource<any>(undefined)
@ -55,6 +57,8 @@
async function performSearch() {
try {
isRunning = true
geolocationState?.allowMoving.setData(true)
geolocationState?.requestMoment.setData(undefined) // If the GPS is still searching for a fix, we say that we don't want tozoom to it anymore
searchContents = searchContents?.trim() ?? ""
if (searchContents === "") {

View file

@ -113,6 +113,7 @@
perLayer={state.perLayer}
{selectedElement}
{triggerSearch}
geolocationState={state.geolocation.geolocationState}
/>
</div>
<button

View file

@ -203,6 +203,8 @@
}}
perLayer={state.perLayer}
selectedElement={state.selectedElement}
geolocationState={state.geolocation.geolocationState}
/>
</If>
</div>