function location_map_link_ca_google in Location 6.3
Same name and namespace in other branches
- 5.3 supported/location.ca.inc \location_map_link_ca_google()
- 5 supported/location.ca.inc \location_map_link_ca_google()
- 7.5 supported/location.ca.inc \location_map_link_ca_google()
- 7.3 supported/location.ca.inc \location_map_link_ca_google()
- 7.4 supported/location.ca.inc \location_map_link_ca_google()
File
- supported/
location.ca.inc, line 131
Code
function location_map_link_ca_google($location = array()) {
$query_params = array();
foreach (array(
'street',
'city',
'province',
'postal_code',
'country',
) as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return 'http://maps.google.ca?q=' . urlencode(implode(", ", $query_params));
}
else {
return NULL;
}
}