]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove name from geocodejson when not set
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 8 Apr 2020 09:12:27 +0000 (11:12 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 8 Apr 2020 09:19:43 +0000 (11:19 +0200)
lib/template/address-geocodejson.php
lib/template/search-geocodejson.php

index 98c368b324b0342b7cb3d2db804eec02337cde7c..0066e80e29adb13cce8320360c57eafddf7ba87e 100644 (file)
@@ -30,7 +30,9 @@ if (empty($aPlace)) {
 
     $aFilteredPlaces['properties']['geocoding']['label'] = $aPlace['langaddress'];
 
 
     $aFilteredPlaces['properties']['geocoding']['label'] = $aPlace['langaddress'];
 
-    $aFilteredPlaces['properties']['geocoding']['name'] = $aPlace['placename'];
+    if ($aPlace['placename'] !== null) {
+        $aFilteredPlaces['properties']['geocoding']['name'] = $aPlace['placename'];
+    }
 
     if (isset($aPlace['address'])) {
         $aPlace['address']->addGeocodeJsonAddressParts(
 
     if (isset($aPlace['address'])) {
         $aPlace['address']->addGeocodeJsonAddressParts(
index dfb402bdb2f485a83a37bc99ad6cc674613c4ea6..3e3a31c443c7948b58e6f8c5500fc366b7f34ad0 100644 (file)
@@ -20,7 +20,9 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
 
     $aPlace['properties']['geocoding']['label'] = $aPointDetails['langaddress'];
 
 
     $aPlace['properties']['geocoding']['label'] = $aPointDetails['langaddress'];
 
-    $aPlace['properties']['geocoding']['name'] = $aPointDetails['placename'];
+    if ($aPointDetails['placename'] !== null) {
+        $aPlace['properties']['geocoding']['name'] = $aPointDetails['placename'];
+    }
 
     if (isset($aPointDetails['address'])) {
         $aPointDetails['address']->addGeocodeJsonAddressParts(
 
     if (isset($aPointDetails['address'])) {
         $aPointDetails['address']->addGeocodeJsonAddressParts(