<?php
header("content-type: text/xml; charset=UTF-8");
- header("Access-Control-Allow-Origin: *");
echo "<";
echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
if (!sizeof($aPlace))
{
- if ($sError)
+ if (isset($sError))
echo "<error>$sError</error>";
else
echo "<error>Unable to geocode</error>";
if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';
echo ">".htmlspecialchars($aPlace['langaddress'])."</result>";
- if ($bShowAddressDetails) {
+ if ($bShowAddressDetails) {
echo "<addressparts>";
foreach($aAddress as $sKey => $sValue)
{
echo "</$sKey>";
}
echo "</addressparts>";
- }
+ }
}
-
+
echo "</reversegeocode>";