Skip to content

Commit

Permalink
updated geocoding API (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
zdila authored Apr 18, 2024
1 parent 305cf83 commit f5b81da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions src/services/geocoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type CommonForwardAndReverseGeocodingOptions =
| "place"
| "postal_code"
| "address"
| "road"
| "poi"
)[];

Expand Down Expand Up @@ -220,6 +221,18 @@ export type GeocodingFeature = Feature<Geometry, FeatureProperties> &
* 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 = {
Expand Down

0 comments on commit f5b81da

Please sign in to comment.