]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/address-json.php
more generalized javascript_renderData
[nominatim.git] / lib / template / address-json.php
index e08b8ac3623b199a14d774356ea30878278ba9b0..83c8b57cb523944e739901f5994895e72db0858e 100644 (file)
@@ -1,7 +1,4 @@
 <?php
-       header ("Content-Type: application/json; charset=UTF-8");
-       header("Access-Control-Allow-Origin: *");
-
        $aFilteredPlaces = array();
 
        if (!sizeof($aPlace))
                 if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
                 if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
                $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
-               $aFilteredPlaces['address'] = $aAddress;
-       }
-
-       if (isset($_GET['json_callback']) && preg_match('/^[-A-Za-z0-9:_.]+$/',$_GET['json_callback']))
-       {
-               echo $_GET['json_callback'].'('.javascript_renderData($aFilteredPlaces).')';
-       }
-       else
-       {
-               echo javascript_renderData($aFilteredPlaces);
+               if ($bShowAddressDetails) $aFilteredPlaces['address'] = $aAddress;
        }
 
+       javascript_renderData($aFilteredPlaces);