Index: supported/location.us.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/supported/location.us.inc,v
retrieving revision 1.23.2.1
diff -u -p -r1.23.2.1 location.us.inc
--- supported/location.us.inc	4 Feb 2009 23:16:17 -0000	1.23.2.1
+++ supported/location.us.inc	4 Feb 2011 01:30:29 -0000
@@ -144,6 +144,29 @@ function location_map_link_us_yahoo($loc
 }
 
 
+function location_map_link_us_bing($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];
+    }
+  }
+
+  $q = "v=2&lvl=10&style=r";
+  if (location_has_coordinates($location)) {
+    $q .= "&cp=". urlencode($location['latitude'] . '~' . $location['longitude']);
+  } else if (count($query_params) > 0) {
+    $q .= "&where1=". urlencode(implode(", ", $query_params));
+  } else {
+    return NULL;
+  }
+
+  return ('http://www.bing.com/maps/default.aspx?'.$q );
+}
+
+
 function location_map_link_us_google($location = array()) {
   $query_params = array();
   $q = NULL;
@@ -206,7 +229,8 @@ function location_map_link_us_mapquest($
 function location_map_link_us_providers() {
   return array('google' => array('name' => 'Google Maps', 'url' => 'http://maps.google.com', 'tos' => 'http://www.google.com/help/terms_local.html'),
                'yahoo' => array('name' => 'Yahoo! Maps', 'url' => 'http://maps.yahoo.com', 'tos' => 'http://help.yahoo.com/help/us/maps/maps-24.html'),
-               'mapquest' => array('name' => 'MapQuest', 'url' => 'http://www.mapquest.com', 'tos' => 'http://www.mapquest.com/features/main.adp?page=legal')
+               'mapquest' => array('name' => 'MapQuest', 'url' => 'http://www.mapquest.com', 'tos' => 'http://www.mapquest.com/features/main.adp?page=legal'),
+               'bing' => array('name' => 'Bing Maps', 'url' => 'http://www.bing.com/maps', 'tos' => 'http://go.microsoft.com/?linkid=9710837')
               );
 }
 
