Migration guide Autocomplete 5
The migration guide shows the changes to the autocomplete and what needs to be adjusted for the new version.
Loader
The server-side loader must hand over to load the autocomplete module in version 5. This is done by adding autocomplete-5
to the libraries
parameter.
https://www.yellowmap.de/api_rst/api/loader?libraries=free-3,autocomplete-5&apiKey={{API_KEY}}
Ready
In the javascript code, the ready function must be passed the parameter { autocomplete: 5 }..
ym.ready({ autocomplete: 5 }, function (modules) {
Changed parameter
For the new Autocomplete, these parameters have been renamed. An overview of all parameters can be found under references.
Old parameter | Renamed to parameter | Description |
---|---|---|
locales |
isoCountries |
The countries to search in: An array with any number of country codes according to ISO-3166-2 is specified. If the parameter is not specified, all supported countries are searched. |
onlyInGeoRect |
inBoundingBox |
Shows only results that are in the rectangle specified in the boundingBoxBoost parameter. |
Return Type
With the new autocomplete there are the return types GeoJSON and JSON. The protobuf data type has been discontinued.
Autocomplete no longer uses the location object to deliver the address data, but delivers it directly to the properties of the geoJSON. The variable names now start with capital letters.
Old returntype: JSON | New returntype: GeoJSON |
---|---|
|
|