function _location_au_geocoder_oneline in Location 7.5
Same name and namespace in other branches
- 5.3 supported/location.au.inc \_location_au_geocoder_oneline()
- 6.3 supported/location.au.inc \_location_au_geocoder_oneline()
- 7.3 supported/location.au.inc \_location_au_geocoder_oneline()
- 7.4 supported/location.au.inc \_location_au_geocoder_oneline()
File
- supported/
location.au.inc, line 416
Code
function _location_au_geocoder_oneline($location = array()) {
$line = '';
$line .= $location['street'] . ', ';
if (strlen($location['city']) && strlen($location['province']) && strlen($location['postal_code'])) {
$line .= $location['city'] . ', ' . $location['province'] . ' ' . $location['postal_code'];
}
elseif (strlen($location['city']) && strlen($location['province'])) {
$line .= $location['city'] . ', ' . $location['state'];
}
elseif (strlen($location['postal_code'])) {
if (strlen($location['city']) || strlen($location['state'])) {
if (strlen($location['city'])) {
$line .= $location['city'] . ', ' . $location['postal_code'];
}
else {
$line .= $location['state'] . ', ' . $location['postal_code'];
}
}
else {
$line .= $location['postal_code'];
}
}
// DEBUG: commented code is for testing/debugging purposes
//print '_location_au_geocoder_oneline() RETURNING '. $line ."<br/>\n";
return $line;
}