You are here

function location_map_link_gb_google in Location 7.3

Same name and namespace in other branches
  1. 7.5 supported/location.gb.inc \location_map_link_gb_google()
  2. 7.4 supported/location.gb.inc \location_map_link_gb_google()

Google link.

File

supported/location.gb.inc, line 161
Great Britain.

Code

function location_map_link_gb_google($location = array()) {
  $query_params = array();
  foreach (array(
    'street',
    'city',
    'postal_code',
    'country',
  ) as $field) {
    if (isset($location[$field])) {
      $query_params[] = $location[$field];
    }
  }
  if (count($query_params)) {
    return 'http://maps.google.co.uk?q=' . urlencode(implode(', ', $query_params));
  }
  else {
    return NULL;
  }
}