Skip to content

Commit c79464a

Browse files
authored
[FIX] adapt nominatim API URL
Using the URL /search/ with trailing slashe is no longer supported see osm-search/Nominatim#3134
1 parent ac3a41d commit c79464a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Classes/FormEngine/FieldControl/LocationMapWizard.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ public function render(): array
4646
// if we have at least some address part (saves geocoding calls)
4747
if ($address) {
4848
// base url
49-
$geoCodeUrlBase = 'https://nominatim.openstreetmap.org/search/';
49+
$geoCodeUrlBase = 'https://nominatim.openstreetmap.org/search?q=';
5050
$geoCodeUrlAddress = $address;
5151
$geoCodeUrlCityOnly = ($row['city'] ?? '');
5252
// urlparams for nominatim which are fixed.
53-
$geoCodeUrlQuery = '?format=json&addressdetails=1&limit=1&polygon_svg=1';
53+
$geoCodeUrlQuery = '&format=json&addressdetails=1&limit=1&polygon_svg=1';
5454
// replace newlines with spaces; remove multiple spaces
5555
$geoCodeUrl = trim(preg_replace('/\s\s+/', ' ', $geoCodeUrlBase . $geoCodeUrlAddress . $geoCodeUrlQuery));
5656
$geoCodeUrlShort = trim(preg_replace('/\s\s+/', ' ', $geoCodeUrlBase . $geoCodeUrlCityOnly . $geoCodeUrlQuery));

0 commit comments

Comments
 (0)