You are here

function location_map_link_nz_mapquest in Location 7.3

Return a MapQuest map URL.

Parameters

array $location: Location data.

Return value

string URL

File

supported/location.nz.inc, line 291
New Zealand.

Code

function location_map_link_nz_mapquest($location = array()) {
  $get_query = '';
  if (isset($location['street'])) {
    $get_query .= 'address=' . urlencode($location['street']) . '&';
  }
  if (isset($location['city'])) {
    $get_query .= 'city=' . urlencode($location['city']) . '&';
  }
  if (isset($location['province'])) {
    $get_query .= 'state=' . urlencode($location['province']) . '&';
  }
  if (isset($location['postal_code'])) {
    $get_query .= 'zipcode=' . urlencode($location['postal_code']);
  }
  if (strlen($get_query)) {
    return 'http://www.mapquest.com/maps/map.adp?searchtype=address&country=NZ&' . $get_query;
  }
  else {
    return NULL;
  }
}