From f5b81da1134bd4cde968d62bf2ad455564e6804a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=BDdila?= Date: Thu, 18 Apr 2024 16:14:47 +0200 Subject: [PATCH] updated geocoding API (#41) --- CHANGELOG.md | 3 +++ src/services/geocoding.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5193b33..0b34401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## DEVEL ### New Features +- Added `matching_text` and `matching_place_name` properties to geocoding feature response +- Added `road` to geocoding `types` + ### Bug Fixes ### Others diff --git a/src/services/geocoding.ts b/src/services/geocoding.ts index 7ecd945..fc7d8ce 100644 --- a/src/services/geocoding.ts +++ b/src/services/geocoding.ts @@ -52,6 +52,7 @@ export type CommonForwardAndReverseGeocodingOptions = | "place" | "postal_code" | "address" + | "road" | "poi" )[]; @@ -220,6 +221,18 @@ export type GeocodingFeature = Feature & * You can use the relevance property to remove results that don't fully match the query. */ relevance: number; + + /** + * A string analogous to the `text` field that more closely matches the query than results in the specified language. + * For example, querying _Praha, Czechia_ with language set to English (`en`) might return a feature with the `text` _Prague_ and the `matching_text` _Praha_. + */ + matching_text?: string; + + /** + * A string analogous to the `place_name` field that more closely matches the query than results in the specified language. + * For example, querying _Praha, Czechia_ with language set to English (`en`) might return a feature with the `place_name` _Prague, Czechia_ and a `matching_place_name` of _Praha, Czechia_. + */ + matching_place_name?: string; }; export type GeocodingSearchResult = {