forked from hans/Nominatim
convert CRLF to make git happy
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
<?php
|
||||
header ("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
|
||||
if (!sizeof($aPlace))
|
||||
{
|
||||
if ($sError)
|
||||
$aFilteredPlaces['error'] = $sError;
|
||||
else
|
||||
$aFilteredPlaces['error'] = 'Unable to geocode';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
|
||||
$aFilteredPlaces['licence'] = "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.";
|
||||
$sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aFilteredPlaces['osm_type'] = $sOSMType;
|
||||
$aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
header ("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
|
||||
if (!sizeof($aPlace))
|
||||
{
|
||||
if ($sError)
|
||||
$aFilteredPlaces['error'] = $sError;
|
||||
else
|
||||
$aFilteredPlaces['error'] = 'Unable to geocode';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
|
||||
$aFilteredPlaces['licence'] = "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.";
|
||||
$sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aFilteredPlaces['osm_type'] = $sOSMType;
|
||||
$aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
<?php
|
||||
header ("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
|
||||
if (!sizeof($aPlace))
|
||||
{
|
||||
if ($sError)
|
||||
$aFilteredPlaces['error'] = $sError;
|
||||
else
|
||||
$aFilteredPlaces['error'] = 'Unable to geocode';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
|
||||
$aFilteredPlaces['licence'] = "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.";
|
||||
$sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aFilteredPlaces['osm_type'] = $sOSMType;
|
||||
$aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
|
||||
}
|
||||
if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
|
||||
if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
|
||||
$aFilteredPlaces['category'] = $aPlace['class'];
|
||||
$aFilteredPlaces['type'] = $aPlace['type'];
|
||||
$aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
|
||||
|
||||
$aFilteredPlaces['display_name'] = $aPlace['langaddress'];
|
||||
$aFilteredPlaces['name'] = $aPlace['placename'];
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
header ("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
|
||||
if (!sizeof($aPlace))
|
||||
{
|
||||
if ($sError)
|
||||
$aFilteredPlaces['error'] = $sError;
|
||||
else
|
||||
$aFilteredPlaces['error'] = 'Unable to geocode';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
|
||||
$aFilteredPlaces['licence'] = "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.";
|
||||
$sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aFilteredPlaces['osm_type'] = $sOSMType;
|
||||
$aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
|
||||
}
|
||||
if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
|
||||
if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
|
||||
$aFilteredPlaces['category'] = $aPlace['class'];
|
||||
$aFilteredPlaces['type'] = $aPlace['type'];
|
||||
$aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
|
||||
|
||||
$aFilteredPlaces['display_name'] = $aPlace['langaddress'];
|
||||
$aFilteredPlaces['name'] = $aPlace['placename'];
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
<?php
|
||||
header("content-type: text/xml; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
echo "<";
|
||||
echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
|
||||
echo ">\n";
|
||||
|
||||
echo "<reversegeocode";
|
||||
echo " timestamp='".date(DATE_RFC822)."'";
|
||||
echo " attribution='Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.'";
|
||||
echo " querystring='".htmlspecialchars($_SERVER['QUERY_STRING'], ENT_QUOTES)."'";
|
||||
echo ">\n";
|
||||
|
||||
if (!sizeof($aPlace))
|
||||
{
|
||||
if ($sError)
|
||||
echo "<error>$sError</error>";
|
||||
else
|
||||
echo "<error>Unable to geocode</error>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<result";
|
||||
if ($aPlace['place_id']) echo ' place_id="'.$aPlace['place_id'].'"';
|
||||
if ($aPlace['osm_type'] && $aPlace['osm_id']) echo ' osm_type="'.($aPlace['osm_type']=='N'?'node':($aPlace['osm_type']=='W'?'way':'relation')).'"'.' osm_id="'.$aPlace['osm_id'].'"';
|
||||
if ($aPlace['ref']) echo ' ref="'.htmlspecialchars($aPlace['ref']).'"';
|
||||
if (isset($aPlace['lat'])) echo ' lat="'.htmlspecialchars($aPlace['lat']).'"';
|
||||
if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';
|
||||
echo ">".htmlspecialchars($aPlace['langaddress'])."</result>";
|
||||
|
||||
if ($bShowAddressDetails) {
|
||||
echo "<addressparts>";
|
||||
foreach($aAddress as $sKey => $sValue)
|
||||
{
|
||||
$sKey = str_replace(' ','_',$sKey);
|
||||
echo "<$sKey>";
|
||||
echo htmlspecialchars($sValue);
|
||||
echo "</$sKey>";
|
||||
}
|
||||
echo "</addressparts>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</reversegeocode>";
|
||||
<?php
|
||||
header("content-type: text/xml; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
echo "<";
|
||||
echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
|
||||
echo ">\n";
|
||||
|
||||
echo "<reversegeocode";
|
||||
echo " timestamp='".date(DATE_RFC822)."'";
|
||||
echo " attribution='Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.'";
|
||||
echo " querystring='".htmlspecialchars($_SERVER['QUERY_STRING'], ENT_QUOTES)."'";
|
||||
echo ">\n";
|
||||
|
||||
if (!sizeof($aPlace))
|
||||
{
|
||||
if ($sError)
|
||||
echo "<error>$sError</error>";
|
||||
else
|
||||
echo "<error>Unable to geocode</error>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<result";
|
||||
if ($aPlace['place_id']) echo ' place_id="'.$aPlace['place_id'].'"';
|
||||
if ($aPlace['osm_type'] && $aPlace['osm_id']) echo ' osm_type="'.($aPlace['osm_type']=='N'?'node':($aPlace['osm_type']=='W'?'way':'relation')).'"'.' osm_id="'.$aPlace['osm_id'].'"';
|
||||
if ($aPlace['ref']) echo ' ref="'.htmlspecialchars($aPlace['ref']).'"';
|
||||
if (isset($aPlace['lat'])) echo ' lat="'.htmlspecialchars($aPlace['lat']).'"';
|
||||
if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';
|
||||
echo ">".htmlspecialchars($aPlace['langaddress'])."</result>";
|
||||
|
||||
if ($bShowAddressDetails) {
|
||||
echo "<addressparts>";
|
||||
foreach($aAddress as $sKey => $sValue)
|
||||
{
|
||||
$sKey = str_replace(' ','_',$sKey);
|
||||
echo "<$sKey>";
|
||||
echo htmlspecialchars($sValue);
|
||||
echo "</$sKey>";
|
||||
}
|
||||
echo "</addressparts>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</reversegeocode>";
|
||||
|
||||
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
foreach($aSearchResults as $iResNum => $aPointDetails)
|
||||
{
|
||||
$aPlace = array(
|
||||
'place_id'=>$aPointDetails['place_id'],
|
||||
'licence'=>"Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",
|
||||
);
|
||||
|
||||
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aPlace['osm_type'] = $sOSMType;
|
||||
$aPlace['osm_id'] = $aPointDetails['osm_id'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['aBoundingBox']))
|
||||
{
|
||||
$aPlace['boundingbox'] = array(
|
||||
$aPointDetails['aBoundingBox'][0],
|
||||
$aPointDetails['aBoundingBox'][1],
|
||||
$aPointDetails['aBoundingBox'][2],
|
||||
$aPointDetails['aBoundingBox'][3]);
|
||||
|
||||
if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
|
||||
{
|
||||
$aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['zoom']))
|
||||
{
|
||||
$aPlace['zoom'] = $aPointDetails['zoom'];
|
||||
}
|
||||
|
||||
$aPlace['lat'] = $aPointDetails['lat'];
|
||||
$aPlace['lon'] = $aPointDetails['lon'];
|
||||
$aPlace['display_name'] = $aPointDetails['name'];
|
||||
|
||||
$aPlace['class'] = $aPointDetails['class'];
|
||||
$aPlace['type'] = $aPointDetails['type'];
|
||||
if ($aPointDetails['icon'])
|
||||
{
|
||||
$aPlace['icon'] = $aPointDetails['icon'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['address']))
|
||||
{
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
$aFilteredPlaces[] = $aPlace;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
<?php
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
foreach($aSearchResults as $iResNum => $aPointDetails)
|
||||
{
|
||||
$aPlace = array(
|
||||
'place_id'=>$aPointDetails['place_id'],
|
||||
'licence'=>"Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",
|
||||
);
|
||||
|
||||
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aPlace['osm_type'] = $sOSMType;
|
||||
$aPlace['osm_id'] = $aPointDetails['osm_id'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['aBoundingBox']))
|
||||
{
|
||||
$aPlace['boundingbox'] = array(
|
||||
$aPointDetails['aBoundingBox'][0],
|
||||
$aPointDetails['aBoundingBox'][1],
|
||||
$aPointDetails['aBoundingBox'][2],
|
||||
$aPointDetails['aBoundingBox'][3]);
|
||||
|
||||
if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
|
||||
{
|
||||
$aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['zoom']))
|
||||
{
|
||||
$aPlace['zoom'] = $aPointDetails['zoom'];
|
||||
}
|
||||
|
||||
$aPlace['lat'] = $aPointDetails['lat'];
|
||||
$aPlace['lon'] = $aPointDetails['lon'];
|
||||
$aPlace['display_name'] = $aPointDetails['name'];
|
||||
|
||||
$aPlace['class'] = $aPointDetails['class'];
|
||||
$aPlace['type'] = $aPointDetails['type'];
|
||||
if ($aPointDetails['icon'])
|
||||
{
|
||||
$aPlace['icon'] = $aPointDetails['icon'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['address']))
|
||||
{
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
$aFilteredPlaces[] = $aPlace;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
foreach($aSearchResults as $iResNum => $aPointDetails)
|
||||
{
|
||||
$aPlace = array(
|
||||
'place_id'=>$aPointDetails['place_id'],
|
||||
'licence'=>"Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",
|
||||
);
|
||||
|
||||
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aPlace['osm_type'] = $sOSMType;
|
||||
$aPlace['osm_id'] = $aPointDetails['osm_id'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['aBoundingBox']))
|
||||
{
|
||||
$aPlace['boundingbox'] = array(
|
||||
$aPointDetails['aBoundingBox'][0],
|
||||
$aPointDetails['aBoundingBox'][1],
|
||||
$aPointDetails['aBoundingBox'][2],
|
||||
$aPointDetails['aBoundingBox'][3]);
|
||||
|
||||
if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
|
||||
{
|
||||
$aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['zoom']))
|
||||
{
|
||||
$aPlace['zoom'] = $aPointDetails['zoom'];
|
||||
}
|
||||
|
||||
$aPlace['lat'] = $aPointDetails['lat'];
|
||||
$aPlace['lon'] = $aPointDetails['lon'];
|
||||
$aPlace['display_name'] = $aPointDetails['name'];
|
||||
|
||||
$aPlace['category'] = $aPointDetails['class'];
|
||||
$aPlace['type'] = $aPointDetails['type'];
|
||||
if ($aPointDetails['icon'])
|
||||
{
|
||||
$aPlace['icon'] = $aPointDetails['icon'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['address']))
|
||||
{
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
$aFilteredPlaces[] = $aPlace;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
<?php
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
foreach($aSearchResults as $iResNum => $aPointDetails)
|
||||
{
|
||||
$aPlace = array(
|
||||
'place_id'=>$aPointDetails['place_id'],
|
||||
'licence'=>"Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",
|
||||
);
|
||||
|
||||
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
$aPlace['osm_type'] = $sOSMType;
|
||||
$aPlace['osm_id'] = $aPointDetails['osm_id'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['aBoundingBox']))
|
||||
{
|
||||
$aPlace['boundingbox'] = array(
|
||||
$aPointDetails['aBoundingBox'][0],
|
||||
$aPointDetails['aBoundingBox'][1],
|
||||
$aPointDetails['aBoundingBox'][2],
|
||||
$aPointDetails['aBoundingBox'][3]);
|
||||
|
||||
if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
|
||||
{
|
||||
$aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['zoom']))
|
||||
{
|
||||
$aPlace['zoom'] = $aPointDetails['zoom'];
|
||||
}
|
||||
|
||||
$aPlace['lat'] = $aPointDetails['lat'];
|
||||
$aPlace['lon'] = $aPointDetails['lon'];
|
||||
$aPlace['display_name'] = $aPointDetails['name'];
|
||||
|
||||
$aPlace['category'] = $aPointDetails['class'];
|
||||
$aPlace['type'] = $aPointDetails['type'];
|
||||
if ($aPointDetails['icon'])
|
||||
{
|
||||
$aPlace['icon'] = $aPointDetails['icon'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['address']))
|
||||
{
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
$aFilteredPlaces[] = $aPlace;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
<?php
|
||||
header("content-type: text/xml; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
echo "<";
|
||||
echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
|
||||
echo ">\n";
|
||||
|
||||
echo "<searchresults";
|
||||
echo " timestamp='".date(DATE_RFC822)."'";
|
||||
echo " attribution='Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.'";
|
||||
echo " querystring='".htmlspecialchars($sQuery, ENT_QUOTES)."'";
|
||||
if ($sViewBox) echo " viewbox='".htmlspecialchars($sViewBox, ENT_QUOTES)."'";
|
||||
echo " polygon='".($bShowPolygons?'true':'false')."'";
|
||||
if (sizeof($aExcludePlaceIDs))
|
||||
{
|
||||
echo " exclude_place_ids='".htmlspecialchars(join(',',$aExcludePlaceIDs))."'";
|
||||
}
|
||||
if ($sMoreURL)
|
||||
{
|
||||
echo " more_url='".htmlspecialchars($sMoreURL)."'";
|
||||
}
|
||||
echo ">\n";
|
||||
|
||||
foreach($aSearchResults as $iResNum => $aResult)
|
||||
{
|
||||
echo "<place place_id='".$aResult['place_id']."'";
|
||||
$sOSMType = ($aResult['osm_type'] == 'N'?'node':($aResult['osm_type'] == 'W'?'way':($aResult['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
echo " osm_type='$sOSMType'";
|
||||
echo " osm_id='".$aResult['osm_id']."'";
|
||||
}
|
||||
echo " place_rank='".$aResult['rank_search']."'";
|
||||
|
||||
if (isset($aResult['aBoundingBox']))
|
||||
{
|
||||
echo ' boundingbox="';
|
||||
echo $aResult['aBoundingBox'][0];
|
||||
echo ','.$aResult['aBoundingBox'][1];
|
||||
echo ','.$aResult['aBoundingBox'][2];
|
||||
echo ','.$aResult['aBoundingBox'][3];
|
||||
echo '"';
|
||||
|
||||
if ($bShowPolygons && isset($aResult['aPolyPoints']))
|
||||
{
|
||||
echo ' polygonpoints=\'';
|
||||
echo javascript_renderData($aResult['aPolyPoints']);
|
||||
echo '\'';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aResult['zoom']))
|
||||
{
|
||||
echo " zoom='".$aResult['zoom']."'";
|
||||
}
|
||||
|
||||
echo " lat='".$aResult['lat']."'";
|
||||
echo " lon='".$aResult['lon']."'";
|
||||
echo " display_name='".htmlspecialchars($aResult['name'], ENT_QUOTES)."'";
|
||||
|
||||
echo " class='".htmlspecialchars($aResult['class'])."'";
|
||||
echo " type='".htmlspecialchars($aResult['type'])."'";
|
||||
if ($aResult['icon'])
|
||||
{
|
||||
echo " icon='".htmlspecialchars($aResult['icon'], ENT_QUOTES)."'";
|
||||
}
|
||||
|
||||
if (isset($aResult['address']))
|
||||
{
|
||||
echo ">";
|
||||
foreach($aResult['address'] as $sKey => $sValue)
|
||||
{
|
||||
$sKey = str_replace(' ','_',$sKey);
|
||||
echo "<$sKey>";
|
||||
echo htmlspecialchars($sValue);
|
||||
echo "</$sKey>";
|
||||
}
|
||||
|
||||
echo "</place>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "/>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</searchresults>";
|
||||
<?php
|
||||
header("content-type: text/xml; charset=UTF-8");
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
|
||||
echo "<";
|
||||
echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
|
||||
echo ">\n";
|
||||
|
||||
echo "<searchresults";
|
||||
echo " timestamp='".date(DATE_RFC822)."'";
|
||||
echo " attribution='Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.'";
|
||||
echo " querystring='".htmlspecialchars($sQuery, ENT_QUOTES)."'";
|
||||
if ($sViewBox) echo " viewbox='".htmlspecialchars($sViewBox, ENT_QUOTES)."'";
|
||||
echo " polygon='".($bShowPolygons?'true':'false')."'";
|
||||
if (sizeof($aExcludePlaceIDs))
|
||||
{
|
||||
echo " exclude_place_ids='".htmlspecialchars(join(',',$aExcludePlaceIDs))."'";
|
||||
}
|
||||
if ($sMoreURL)
|
||||
{
|
||||
echo " more_url='".htmlspecialchars($sMoreURL)."'";
|
||||
}
|
||||
echo ">\n";
|
||||
|
||||
foreach($aSearchResults as $iResNum => $aResult)
|
||||
{
|
||||
echo "<place place_id='".$aResult['place_id']."'";
|
||||
$sOSMType = ($aResult['osm_type'] == 'N'?'node':($aResult['osm_type'] == 'W'?'way':($aResult['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType)
|
||||
{
|
||||
echo " osm_type='$sOSMType'";
|
||||
echo " osm_id='".$aResult['osm_id']."'";
|
||||
}
|
||||
echo " place_rank='".$aResult['rank_search']."'";
|
||||
|
||||
if (isset($aResult['aBoundingBox']))
|
||||
{
|
||||
echo ' boundingbox="';
|
||||
echo $aResult['aBoundingBox'][0];
|
||||
echo ','.$aResult['aBoundingBox'][1];
|
||||
echo ','.$aResult['aBoundingBox'][2];
|
||||
echo ','.$aResult['aBoundingBox'][3];
|
||||
echo '"';
|
||||
|
||||
if ($bShowPolygons && isset($aResult['aPolyPoints']))
|
||||
{
|
||||
echo ' polygonpoints=\'';
|
||||
echo javascript_renderData($aResult['aPolyPoints']);
|
||||
echo '\'';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aResult['zoom']))
|
||||
{
|
||||
echo " zoom='".$aResult['zoom']."'";
|
||||
}
|
||||
|
||||
echo " lat='".$aResult['lat']."'";
|
||||
echo " lon='".$aResult['lon']."'";
|
||||
echo " display_name='".htmlspecialchars($aResult['name'], ENT_QUOTES)."'";
|
||||
|
||||
echo " class='".htmlspecialchars($aResult['class'])."'";
|
||||
echo " type='".htmlspecialchars($aResult['type'])."'";
|
||||
if ($aResult['icon'])
|
||||
{
|
||||
echo " icon='".htmlspecialchars($aResult['icon'], ENT_QUOTES)."'";
|
||||
}
|
||||
|
||||
if (isset($aResult['address']))
|
||||
{
|
||||
echo ">";
|
||||
foreach($aResult['address'] as $sKey => $sValue)
|
||||
{
|
||||
$sKey = str_replace(' ','_',$sKey);
|
||||
echo "<$sKey>";
|
||||
echo htmlspecialchars($sValue);
|
||||
echo "</$sKey>";
|
||||
}
|
||||
|
||||
echo "</place>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "/>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</searchresults>";
|
||||
|
||||
Reference in New Issue
Block a user