function location_map_link_de_google in Location 6.3
Same name and namespace in other branches
- 5.3 supported/location.de.inc \location_map_link_de_google()
- 7.5 supported/location.de.inc \location_map_link_de_google()
- 7.3 supported/location.de.inc \location_map_link_de_google()
- 7.4 supported/location.de.inc \location_map_link_de_google()
File
- supported/
location.de.inc, line 161
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;
}
}