diff --git a/handlers/location_handler_field_location_distance.inc b/handlers/location_handler_field_location_distance.inc index 49013e0..f5fc5f7 100644 --- a/handlers/location_handler_field_location_distance.inc +++ b/handlers/location_handler_field_location_distance.inc @@ -49,6 +49,7 @@ class location_handler_field_location_distance extends views_handler_field { 'php' => t('Use PHP code to determine latitude/longitude'), 'nid_arg' => t("Node's Latitude / Longitude from views nid argument"), 'uid_arg' => t("User's Latitude / Longitude from views uid argument"), + 'distance_arg' => t("Latitude / Longitude from views argument"), ), '#description' => t("This will be the way the latitude/longitude of origin is determined. When using the user's latitude / longitude, if a user has multiple locations the first will be used."), '#default_value' => $this->options['origin'], diff --git a/location.views.inc b/location.views.inc index feb07c0..db9efc1 100644 --- a/location.views.inc +++ b/location.views.inc @@ -540,6 +540,14 @@ function location_views_proximity_get_reference_location($view, $options) { } } break; + case 'distance_arg': + list($coord, $distance) = explode('_', $view->args[0]); + list($lat, $lon) = explode(',', $coord); + $coordinates['latitude'] = (float) $lat; + $coordinates['longitude'] = (float) $lon; + + break; + } return $coordinates;