You are here

function location_map_link_uk_google in Location 5.3

Same name and namespace in other branches
  1. 6.3 supported/location.uk.inc \location_map_link_uk_google()

File

supported/location.uk.inc, line 256

Code

function location_map_link_uk_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;
  }
}