--- location_handler_field_location_distance.inc	2009-01-21 15:39:16.000000000 -0600
+++ location_handler_field_location_distance.inc.new	2010-03-03 20:21:07.000000000 -0600
@@ -40,6 +40,7 @@
         'hybrid' => t("User's location (fall back to static if unset)"),
         'static' => t("Static location"),
         'tied' => t("Use Distance / Proximity filter"),
+        'argument' => t("Use Distance / Proximity argument"),
       ),
       '#description' => t('FIXME'),
       '#default_value' => $this->options['origin'],
@@ -105,6 +106,19 @@
       }
     }
 
+    if ($this->options['origin'] == 'argument') {
+      if (!empty($this->view->argument)) {
+        foreach ($this->view->argument as $k => $v) {
+          if ($v->table == 'location' && $v->field == 'distance' && $v->options['relationship'] == $this->options['relationship']) {
+            if ($v->calculate_coords()) {
+              $latitude = (float)$v->value['latitude'];
+              $longitude = (float)$v->value['longitude'];
+            }
+          }
+        }
+      }
+    }
+
     $this->ensure_my_table();
 
     if (empty($latitude) && empty($longitude)) {
