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

Fix/documentation supplement in address search #221

Closed
4 changes: 4 additions & 0 deletions packages/plugins/AddressSearch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## unpublished

- Fix: Add necessary typecast in configuration examples for `bkg` and `mpapi` search methods.

## 2.0.0

- Breaking: Upgrade `@masterportal/masterportalapi` from `2.8.0` to `2.40.0` and subsequently `ol` from `7.1.0` to `^9.2.4`.
Expand Down
14 changes: 7 additions & 7 deletions packages/plugins/AddressSearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ addressSearch: {
searchAddress: true,
searchStreets: true,
searchHouseNumbers: true,
},
} as MpApiParameters,
type: 'mpapi',
url: 'example-url.com',
},
Expand All @@ -60,7 +60,7 @@ addressSearch: {
filter: {
bundesland: 'Schleswig-Holstein',
},
},
} as BKGParameters,
type: 'bkg',
url: 'other-example-url.com',
},
Expand Down Expand Up @@ -119,7 +119,7 @@ Example configuration:
queryParameters: {
filter: {
bundesland: 'Schleswig-Holstein',
},
} as BKGParameters,
},
},
],
Expand Down Expand Up @@ -281,20 +281,20 @@ queryParameters: {
| searchStreetKey | Boolean? | Defines whether streets should be searched for by key. |
| searchStreets | Boolean? | Defines whether street search is active. Precondition to set `searchHouseNumbers` to `true`. |

While all fields are optional, configuring none of them will yield undefined behaviour. At least one search instruction should be set to `true`.
While all fields are optional, configuring none of them will yield undefined behaviour. At least one search instruction should be set to `true`. Since `queryParameters` is a general type it has to be specified that in this case it is of the type `MpApiParameters`.

```js
type: 'mpapi'
queryParameters: {
searchAddress: true,
searchStreets: true,
searchHouseNumbers: true,
},
} as MpApiParameters,
```

##### addressSearch.searchMethodsObject.queryParameters (type:bkg)

In _BKG_ mode, queryParameter's key-value pairs are used in the service query. E.g. `{filter: { bundesland: 'Bremen' }}` results in the GET request URL having `&filter=bundesland:Bremen` as suffix.
In _BKG_ mode, queryParameter's key-value pairs are used in the service query. E.g. `{filter: { bundesland: 'Bremen' }}` results in the GET request URL having `&filter=bundesland:Bremen` as suffix. Since `queryParameters` is a general type it has to be specified that in this case it is of the type `BKGParameters`.

For more options, please check the [official documentation](https://sg.geodatenzentrum.de/web_public/gdz/dokumentation/deu/geokodierungsdienst.pdf) regarding what query parameters are interpreted.

Expand All @@ -306,7 +306,7 @@ type: 'bkg'
queryParameters: {
filter: {
bundesland: 'Schleswig-Holstein',
},
} as BKGParameters,
},
```

Expand Down