function getWordSets($aWords, $iDepth)
{
- $aResult = array(array(join(' ',$aWords)));
+ $aResult = array(array(join(' ', $aWords)));
$sFirstToken = '';
if ($iDepth < 8) {
while (sizeof($aWords) > 1) {
$sFirstToken .= ($sFirstToken?' ':'').$sWord;
$aRest = getWordSets($aWords, $iDepth+1);
foreach ($aRest as $aSet) {
- $aResult[] = array_merge(array($sFirstToken),$aSet);
+ $aResult[] = array_merge(array($sFirstToken), $aSet);
}
}
}
function getInverseWordSets($aWords, $iDepth)
{
- $aResult = array(array(join(' ',$aWords)));
+ $aResult = array(array(join(' ', $aWords)));
$sFirstToken = '';
if ($iDepth < 8) {
while (sizeof($aWords) > 1) {
$sFirstToken = $sWord.($sFirstToken?' ':'').$sFirstToken;
$aRest = getInverseWordSets($aWords, $iDepth+1);
foreach ($aRest as $aSet) {
- $aResult[] = array_merge(array($sFirstToken),$aSet);
+ $aResult[] = array_merge(array($sFirstToken), $aSet);
}
}
}
) {
$fDiameter = $aClassType[$aResult['class'].':'.$aResult['type'].':'.$aResult['admin_level']]['defdiameter'];
} elseif (isset($aResult['class'])
- && isset($aResult['type'])
- && isset($aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter'])
- && $aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter']
+ && isset($aResult['type'])
+ && isset($aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter'])
+ && $aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter']
) {
$fDiameter = $aClassType[$aResult['class'].':'.$aResult['type']]['defdiameter'];
}
header("Content-Type: application/json; charset=UTF-8");
echo $jsonout;
} else {
- if (preg_match('/^[$_\p{L}][$_\p{L}\p{Nd}.[\]]*$/u',$_GET['json_callback'])) {
+ if (preg_match('/^[$_\p{L}][$_\p{L}\p{Nd}.[\]]*$/u', $_GET['json_callback'])) {
header("Content-Type: application/javascript; charset=UTF-8");
echo $_GET['json_callback'].'('.$jsonout.')';
} else {
}
if ($aTypeLabel && ((isset($aLine['localname']) && $aLine['localname']) || (isset($aLine['housenumber']) && $aLine['housenumber']))) {
$sTypeLabel = strtolower(isset($aTypeLabel['simplelabel'])?$aTypeLabel['simplelabel']:$aTypeLabel['label']);
- $sTypeLabel = str_replace(' ','_',$sTypeLabel);
+ $sTypeLabel = str_replace(' ', '_', $sTypeLabel);
if (!isset($aAddress[$sTypeLabel]) || (isset($aFallback[$sTypeLabel]) && $aFallback[$sTypeLabel]) || $aLine['class'] == 'place') {
$aAddress[$sTypeLabel] = $aLine['localname']?$aLine['localname']:$aLine['housenumber'];
}
}
// returns boolean
-function validLatLon($fLat,$fLon)
+function validLatLon($fLat, $fLon)
{
return ($fLat <= 90.1 && $fLat >= -90.1 && $fLon <= 180.1 && $fLon >= -180.1);
}