forked from MapComplete/MapComplete
Feature(geocoding): pressing enter will now zoom to the first search result; refactor away type synonym
This commit is contained in:
parent
9e8aaab086
commit
686ad70511
8 changed files with 64 additions and 49 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue