]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/lookup.php
use already existing address field in geocodejson
[nominatim.git] / website / lookup.php
index b9cc88f767ccd19df7a90b00e581d931ab7b8231..695a083a4fb3c5acb800f55c36b0e856048e7e99 100755 (executable)
@@ -11,7 +11,7 @@ ini_set('memory_limit', '200M');
 $oParams = new Nominatim\ParameterParser();
 
 // Format for output
-$sOutputFormat = $oParams->getSet('format', array('xml', 'json'), 'xml');
+$sOutputFormat = $oParams->getSet('format', array('xml', 'json', 'geojson'), 'xml');
 
 // Preferred language
 $aLangPrefOrder = $oParams->getPreferredLanguages();
@@ -63,7 +63,8 @@ $sQuery = join(',', $aCleanedQueryParts);
 // we initialize these to avoid warnings in our logfile
 $sViewBox = '';
 $bShowPolygons = '';
-$aExcludePlaceIDs = [];
+$aExcludePlaceIDs = array();
 $sMoreURL = '';
 
-include(CONST_BasePath.'/lib/template/search-'.$sOutputFormat.'.php');
+$sOutputTemplate = ($sOutputFormat == 'jsonv2') ? 'json' : $sOutputFormat;
+include(CONST_BasePath.'/lib/template/search-'.$sOutputTemplate.'.php');