function location_map_link_pt_google in Location 7.3
Google link.
File
- supported/
location.pt.inc, line 59 - Portugal.
Code
function location_map_link_pt_google($location = array()) {
$query_params = array();
$q = NULL;
foreach (array(
'street',
'city',
'province',
'postal_code',
'country',
) as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (location_has_coordinates($location)) {
$q = urlencode($location['latitude'] . ' ' . $location['longitude'] . ' (' . implode(', ', $query_params) . ')');
}
else {
if (count($query_params) > 0) {
$q = urlencode(implode(", ", $query_params));
}
}
if ($q != NULL) {
return 'http://maps.google.pt?q=' . $q;
}
else {
return NULL;
}
if (count($query_params)) {
return 'http://maps.google.pt?q=' . urlencode(implode(', ', $query_params));
}
else {
return NULL;
}
}