Skip to content

Commit

Permalink
Update LocationMapWizard.php
Browse files Browse the repository at this point in the history
Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation.

Examples how to change the URL:

You use: https://nominatim.openstreetmap.org/search/?q=Berlin
Change to: https://nominatim.openstreetmap.org/search?q=Berlin


See github issue #3134 for more details.

osm-search/Nominatim#3134
  • Loading branch information
markussoeth authored Aug 3, 2023
1 parent 8f77d2e commit 2deef28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/FormEngine/FieldControl/LocationMapWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public function render(): array
// if we have at least some address part (saves geocoding calls)
if ($address) {
// base url
$geoCodeUrlBase = 'https://nominatim.openstreetmap.org/search/';
$geoCodeUrlBase = 'https://nominatim.openstreetmap.org/search?q=';
$geoCodeUrlAddress = $address;
$geoCodeUrlCityOnly = ($row['city'] ?? '');
// urlparams for nominatim which are fixed.
$geoCodeUrlQuery = '?format=json&addressdetails=1&limit=1&polygon_svg=1';
$geoCodeUrlQuery = '&format=json&addressdetails=1&limit=1&polygon_svg=1';
// replace newlines with spaces; remove multiple spaces
$geoCodeUrl = trim(preg_replace('/\s\s+/', ' ', $geoCodeUrlBase . $geoCodeUrlAddress . $geoCodeUrlQuery));
$geoCodeUrlShort = trim(preg_replace('/\s\s+/', ' ', $geoCodeUrlBase . $geoCodeUrlCityOnly . $geoCodeUrlQuery));
Expand Down

0 comments on commit 2deef28

Please sign in to comment.