X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/7769b0a8236575dddae43ec2f4f94d38a22e4747..3b44edf4a5e49f1485dd28b943429656de720d17:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index df65848d..50cf3dc4 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -39,6 +39,12 @@ exit; } + function getParamBool($name, $default=false) + { + if (!isset($_GET[$name])) return $default; + + return (bool) $_GET[$name]; + } function fail($sError, $sUserError = false) { @@ -438,7 +444,6 @@ 'tourism:hotel' => array('label'=>'Hotel','frequency'=>2150,'icon'=>'accommodation_hotel2',), 'tourism:motel' => array('label'=>'Motel','frequency'=>43,'icon'=>'',), 'amenity:cinema' => array('label'=>'Cinema','frequency'=>277,'icon'=>'tourist_cinema',), - 'tourism:information' => array('label'=>'Information','frequency'=>224,'icon'=>'amenity_information',), 'tourism:artwork' => array('label'=>'Artwork','frequency'=>171,'icon'=>'tourist_art_gallery2',), 'historic:archaeological_site' => array('label'=>'Archaeological Site','frequency'=>407,'icon'=>'tourist_archaeological2',), 'amenity:doctors' => array('label'=>'Doctors','frequency'=>581,'icon'=>'health_doctors',), @@ -512,6 +517,7 @@ 'shop:travel_agency' => array('label'=>'Travel Agency','frequency'=>21,'icon'=>'',), 'shop:hifi' => array('label'=>'Hifi','frequency'=>21,'icon'=>'',), 'amenity:shop' => array('label'=>'Shop','frequency'=>61,'icon'=>'',), + 'tourism:information' => array('label'=>'Information','frequency'=>224,'icon'=>'amenity_information',), 'place:house' => array('label'=>'House','frequency'=>2086,'icon'=>'','defzoom'=>18,), 'place:house_name' => array('label'=>'House','frequency'=>2086,'icon'=>'','defzoom'=>18,), @@ -668,10 +674,12 @@ } - function javascript_renderData($xVal) + function javascript_renderData($xVal, $iOptions = 0) { header("Access-Control-Allow-Origin: *"); - $jsonout = json_encode($xVal); + if (defined('PHP_VERSION_ID') && PHP_VERSION_ID > 50400) + $iOptions |= JSON_UNESCAPED_UNICODE; + $jsonout = json_encode($xVal, $iOptions); if( ! isset($_GET['json_callback'])) { @@ -962,7 +970,7 @@ } // degrees decimal seconds // N 40 26 46 W 79 58 56 - // N 40° 26′ 46″ W, 79° 58′ 56″ + // N 40° 26′ 46″, W 79° 58′ 56″ // 1 2 3 4 5 6 7 8 elseif (preg_match('/\\b([NS])[ ]([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+)[″"]*[, ]+([EW])[ ]([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+)[″"]*\\b/', $sQuery, $aData)) {