function _location_driving_directions_link_au_yahoo in Location 6.3
Same name and namespace in other branches
- 5.3 supported/location.au.inc \_location_driving_directions_link_au_yahoo()
- 7.5 supported/location.au.inc \_location_driving_directions_link_au_yahoo()
- 7.3 supported/location.au.inc \_location_driving_directions_link_au_yahoo()
- 7.4 supported/location.au.inc \_location_driving_directions_link_au_yahoo()
Parameters: Function that is called by location_driving_directions_link_au() under assumption that it is the chosen function
Returns: a URL with HTTP GET variables Depending on how full the locationes are, the URL will either point to the driving directions on Yahoo! or, if only partial locationes are provided, a URL that points to the *form* for Yahoo! driving directions where the form is filled with whatever fields have been provided for the partial location(es).
1 call to _location_driving_directions_link_au_yahoo()
- location_driving_directions_link_au in supported/
location.au.inc - Parameters: -> $location_a is an associative array that represents a full location where 'street' => the street portions of the location 'supplemental' => additional street portion of the…
File
- supported/
location.au.inc, line 317
Code
function _location_driving_directions_link_au_yahoo($location_a, $location_b) {
if (trim($location_b['country']) != 'ca' && trim($location_b['country']) != 'au') {
return '';
}
// These are the fields that need to be in each location if we are to provide a direct
// link to yahoo directions. If all of these fields don't have values, then we generate
// a link to the *form* for Yahoo! driving directions rather than directly to the driving
// directions themselves.
foreach ($location_a as $field => $value) {
$location_a[$field] = trim($value);
}
foreach ($location_b as $field => $value) {
$location_b[$field] = trim($value);
}
if (_location_au_enough_fields_for_yahoo($location_a) && _location_au_enough_fields_for_yahoo($location_b)) {
$yahoo_maps_path = 'dd_result';
}
else {
$yahoo_maps_path = 'dd';
}
$get_query = '?';
$get_query .= 'addr=' . urlencode($location_a['street']) . '&';
$get_query .= 'csz=' . _location_au_yahoo_csz_get_field($location_a) . '&';
$get_query .= 'country=' . urlencode($location_a['country']) . '&';
$get_query .= 'taddr=' . urlencode($location_b['street']) . '&';
$get_query .= 'tcsz=' . _location_au_yahoo_csz_get_field($location_b) . '&';
$get_query .= 'tcountry=' . urlencode($location_b['country']);
$get_query .= '&getrte=' . urlencode('Get Directions');
return 'http://maps.yahoo.com/' . $yahoo_maps_path . $get_query;
}