You are here

function location_map_link_be_google in Location 7.3

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

Google link.

File

supported/location.be.inc, line 66
Belgium.

Code

function location_map_link_be_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.be?q=' . urlencode(implode(', ', $query_params));
  }
  else {
    return NULL;
  }
}