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