X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/2ab9e4acd3a2ceb5ff871b6b6afc786377e8739f..c3238682a8867edfb3c052ca4d2d27b3926ad17a:/website/polygons.php diff --git a/website/polygons.php b/website/polygons.php index c5fbafc2..88b48ae8 100644 --- a/website/polygons.php +++ b/website/polygons.php @@ -1,19 +1,19 @@ getSet('format', array('html', 'json'), 'html'); +$sOutputFormat = $oParams->getSet('format', array('json'), 'json'); set_exception_handler_by_format($sOutputFormat); $iDays = $oParams->getInt('days', false); $bReduced = $oParams->getBool('reduced', false); $sClass = $oParams->getString('class', false); -$oDB = new Nominatim\DB(); +$oDB = new Nominatim\DB(CONST_Database_DSN); $oDB->connect(); $iTotalBroken = (int) $oDB->getOne('SELECT count(*) FROM import_polygon_error'); @@ -47,7 +47,5 @@ if (CONST_Debug) { } if ($sOutputFormat == 'json') { - echo javascript_renderData($aPolygons); -} else { - include(CONST_BasePath.'/lib/template/polygons-html.php'); + javascript_renderData($aPolygons); }