You are here

function location_map_link_ca_mapquest in Location 7.3

Same name and namespace in other branches
  1. 5.3 supported/location.ca.inc \location_map_link_ca_mapquest()
  2. 5 supported/location.ca.inc \location_map_link_ca_mapquest()
  3. 6.3 supported/location.ca.inc \location_map_link_ca_mapquest()
  4. 7.5 supported/location.ca.inc \location_map_link_ca_mapquest()
  5. 7.4 supported/location.ca.inc \location_map_link_ca_mapquest()

MapQuest link.

File

supported/location.ca.inc, line 176
Canada.

Code

function location_map_link_ca_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=CA&' . $get_query;
  }
  else {
    return NULL;
  }
}