You are here

function _location_driving_directions_link_ch_search in Location 5.3

Same name and namespace in other branches
  1. 6.3 supported/location.ch.inc \_location_driving_directions_link_ch_search()
  2. 7.5 supported/location.ch.inc \_location_driving_directions_link_ch_search()
  3. 7.3 supported/location.ch.inc \_location_driving_directions_link_ch_search()
  4. 7.4 supported/location.ch.inc \_location_driving_directions_link_ch_search()
1 call to _location_driving_directions_link_ch_search()
location_driving_directions_link_ch in supported/location.ch.inc

File

supported/location.ch.inc, line 88

Code

function _location_driving_directions_link_ch_search($location_a, $location_b) {
  $query_params_a = array();
  $query_params_b = array();
  foreach (array(
    'street',
    'postal_code',
    'city',
  ) as $field) {
    if (isset($location_a[$field])) {
      $query_params_a[] = $location_a[$field];
    }
    if (isset($location_b[$field])) {
      $query_params_b[] = $location_b[$field];
    }
  }
  return 'http://route.search.ch/?route=' . urlencode(implode(' ', $query_params_a) . ' to ' . implode(' ', $query_params_b));
}