Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geocoding API update #41

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading