You are here

function _getdirections_loadaddress in Get Directions 6

Same name and namespace in other branches
  1. 6.2 getdirections.module \_getdirections_loadaddress()
  2. 7.3 getdirections.module \_getdirections_loadaddress()
  3. 7.2 getdirections.module \_getdirections_loadaddress()

Function to collect an address

Parameters

$location:

Return value

Returns array.

8 calls to _getdirections_loadaddress()
getdirections_n2u_setlocation in ./getdirections.module
Function to setup the map
getdirections_setlocation in ./getdirections.module
Function to setup the map and form
getdirections_setlocations in ./getdirections.module
Function to setup the map
getdirections_setlocations_via in ./getdirections.module
Function to setup the map to display waypoints
getdirections_u2n_setlocation in ./getdirections.module
Function to setup the map and form

... See full list

File

./getdirections.module, line 821
Fetches google map directions.

Code

function _getdirections_loadaddress($location) {
  if (isset($location['name']) && $location['name']) {
    $loc[] = $location['name'];
  }
  if (isset($location['street']) && $location['street']) {
    $loc[] = $location['street'];
  }
  if (isset($location['additional']) && $location['additional']) {
    $loc[] = $location['additional'];
  }
  if (isset($location['city']) && $location['city']) {
    $loc[] = $location['city'];
  }
  if (isset($location['province_name']) && $location['province_name']) {
    $loc[] = $location['province_name'];
  }
  if (isset($location['postal_code']) && $location['postal_code']) {
    $loc[] = $location['postal_code'];
  }
  return $loc;
}