You are here

function location_map_link_de_google in Location 7.3

Same name and namespace in other branches
  1. 5.3 supported/location.de.inc \location_map_link_de_google()
  2. 6.3 supported/location.de.inc \location_map_link_de_google()
  3. 7.5 supported/location.de.inc \location_map_link_de_google()
  4. 7.4 supported/location.de.inc \location_map_link_de_google()

Google link.

File

supported/location.de.inc, line 199
Deutschland.

Code

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