Feature(geocoding): pressing enter will now zoom to the first search result; refactor away type synonym

This commit is contained in:
Pieter Vander Vennet 2025-03-11 03:45:11 +01:00
parent 9e8aaab086
commit 686ad70511
8 changed files with 64 additions and 49 deletions

View file

@ -3,7 +3,7 @@ import { BBox } from "../BBox"
import Constants from "../../Models/Constants"
import { FeatureCollection } from "geojson"
import Locale from "../../UI/i18n/Locale"
import GeocodingProvider, { GeocodingOptions, SearchResult } from "./GeocodingProvider"
import GeocodingProvider, { GeocodeResult, GeocodingOptions } from "./GeocodingProvider"
export class NominatimGeocoding implements GeocodingProvider {
private readonly _host
@ -15,7 +15,7 @@ export class NominatimGeocoding implements GeocodingProvider {
this._host = host
}
public search(query: string, options?: GeocodingOptions): Promise<SearchResult[]> {
public search(query: string, options?: GeocodingOptions): Promise<GeocodeResult[]> {
const b = options?.bbox ?? BBox.global
const url = `${this._host}search?format=json&limit=${
this.limit