Skip to content

Commit fc05d91

Browse files
committed
touched up README file
1 parent 3e72efa commit fc05d91

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

packages/plugins/Routing/README.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,70 +13,70 @@ This module has been written for the "BKG-Routing-Service" and uses the "Adresss
1313
| - | - | - |
1414
|serviceUrl|string|The url of the routing service to be used.|
1515
|format|string|The format in which the answer of the routing service is expected in.|
16-
|selectableTravelModes|string[]|Specifies which selection of transportation modes (e.g. driving-car, driving-hgv, foot-walking, cycling-regular, wheelchair) is available to the user. In the default setting, all modes are offered.|
17-
|selectable Preferences|string[]|Specifies which preferences for the route are offered to the user.|
16+
|selectableTravelModes|string[]|Specifies which selection of transportation modes (driving-car, driving-hgv, foot-walking, cycling-regular, wheelchair) is available to the user. In the default setting, all modes are offered.|
17+
|selectable Preferences|string[]|Specifies which preferences for the route (recommended, fastest, shortest) are offered to the user.|
1818
|displayPreferences|bolean|Defines wether the preferences for the route are offered to the user for selection.|
1919
|displayRouteTypesToAvoid|boolean|Defines wether route types to avoid are offered to the user for selection.|
20-
|routeStyle|||
20+
|routeStyle|style? | Please see example below for styling options. Defaults to standard OpenLayers styling. |
2121
|routeStyle.stroke|||
22+
|addressSearch|||
23+
|searchMethods | searchMethodsObject[] | Array of search method descriptions. Only searches configured here can be used. |
24+
|minLength | number? | Minimal input length after which searches are started. Defaults to 0. |
25+
|waitMs | number? | Debounce time in ms for search requests after last user input. Defaults to 0. |
26+
27+
#### routeStyle.stroke
28+
29+
| fieldName | type | description |
30+
| - | - | - |
2231
|routeStyle.color|||
2332
|routeStyle.width|||
24-
|addressSearch|||
25-
|addressSearch.addLoading|||
26-
|addressSearch.removeLoading|||
27-
|addressSearch.searchMethods|||
28-
|addressSearch.searchMethods.queryParameters|||
29-
|addressSearch.searchMethods.queryParameters.searchAddress|boolean||
30-
|addressSearch.searchMethods.queryParameters.searchStreets|boolean||
31-
|addressSearch.searchMethods.queryParameters.searchHouseNumbers|boolean||
32-
|addressSearch.searchMethods.type|string||
33-
|addressSearch.searchMethods.url|string|The url of the service to be used for the address search.|
34-
|addressSearch.minLength|number||
35-
|addressSearch.waitMs|number||
3633

37-
## Store // TODO: Ans Routing-Plugin anpassen
34+
<details>
3835

39-
### Mutations
36+
The `@masterportal/masterportalapi` has vectorStyles in development. As soon as that's done, we shall use its styling syntax and methods.
4037

41-
#### setSelectedGroupName
38+
For the time being, please use this example as a rough reference as to what can currently be done.
4239

43-
This can be used to change the selected search group by name.
40+
<summary>Example configuration</summary>
4441

4542
```js
46-
map.$store.commit(
47-
'plugin/addressSearch/setSelectedGroupName',
48-
'Parcel search'
49-
)
43+
routing: {
44+
routeStyle: {
45+
stroke: {
46+
color: '#e51313',
47+
width: 6,
48+
},
49+
},
50+
}
5051
```
5152

52-
Please mind that programmatically changing the search group will _not_ trigger a search, unlike a search group change by the user. If you need a search after change, consider the `search` action.
53-
54-
### Actions
53+
</details>
5554

56-
#### search
55+
#### addressSearch.searchMethodsObject
5756

58-
This is a purely programmatical search method. It is not used by user input.
57+
| fieldName | type | description |
58+
| - | - | - |
59+
| queryParameters | object? | The object further describes details for the search request. Its contents vary by service type, see documentation below. |
60+
| type | enum["bkg", "wfs", "mpapi"] | Service type. For now, mpapi is the only option. |
61+
| url | string | Search service URL. Should you require a service provider, please contact us for further information. |
5962

60-
```js
61-
map.$store.dispatch('plugin/addressSearch/search', {
62-
input: 'Station Road 12',
63-
autoselect: 'first',
64-
})
65-
```
63+
##### addressSearch.searchMethodsObject.queryParameters (type:mpapi)
6664

67-
The payload object supports the following fields:
65+
> **Please mind that this requires a configured backend. A WFS's Stored Query is requested with predefined parameters using the [masterportalapi](https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/src/master/). This implementation is meant for e.g. https://geodienste.hamburg.de/HH_WFS_GAGES, but works with other WFS configured in the same manner.**
6866
69-
| fieldName | type | description |
67+
| fieldName | Type | Description |
7068
| - | - | - |
71-
| input | string | Search string to be used. |
72-
| autoselect | enum['first', 'only', 'never'] | By default, 'never' is selected, and results will be presented as if the user searched for them. Setting 'only' will autoselect if a single result was returned; setting 'first' will autoselect the first of an arbitrary amount of results >=1. |
69+
| searchAddress | Boolean? | Defines whether address search is active. For backward compatibility, if "searchAddress" is not configured, the "searchAddress" attribute is set to "true" when "searchStreets" and "searchHouseNumbers" are set to "true". |
70+
| searchStreets | Boolean? | Defines whether street search is active. Precondition to set `searchHouseNumbers` to `true`. |
71+
| searchHouseNumbers | Boolean? | Defines whether house numbers should be searched for. Requires `searchStreets` to be set to `true`, too. |
7372

74-
### State
73+
While all fields are optional, configuring none of them will yield undefined behaviour. At least one search instruction should be set to `true`.
7574

7675
```js
77-
map.subscribe('plugin/addressSearch/chosenAddress', (chosenAddress) => {
78-
/* Your code. */
79-
})
76+
type: 'mpapi'
77+
queryParameters: {
78+
searchAddress: true,
79+
searchStreets: true,
80+
searchHouseNumbers: true,
81+
},
8082
```
81-
82-
Address object _as returned by search service_. The result and its fields differ depending on the used backend. The callback is used whenever the user clicks on a search result or started a one-result search, which results in an auto-select of the singular result.

0 commit comments

Comments
 (0)