You are here

function _location_au_geocoder_oneline in Location 7.3

Same name and namespace in other branches
  1. 5.3 supported/location.au.inc \_location_au_geocoder_oneline()
  2. 6.3 supported/location.au.inc \_location_au_geocoder_oneline()
  3. 7.5 supported/location.au.inc \_location_au_geocoder_oneline()
  4. 7.4 supported/location.au.inc \_location_au_geocoder_oneline()

Geocoder oneline.

File

supported/location.au.inc, line 502
Australia.

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'];
    }
  }
  return $line;
}