function _location_nz_geocoder_oneline in Location 7.3
Geocode oneline.
File
- supported/
location.nz.inc, line 593 - New Zealand.
Code
function _location_nz_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'];
}
}
return $line;
}