Index: location.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/location/location.module,v retrieving revision 1.79.2.2 diff -u -p -r1.79.2.2 location.module --- location.module 24 Feb 2007 23:32:14 -0000 1.79.2.2 +++ location.module 5 Mar 2007 20:07:14 -0000 @@ -1385,7 +1385,13 @@ function location_user($op, &$edit, &$us $form[0]['location']['#tree'] = TRUE; $form[0]['location']['#collapsible'] = TRUE; $form[0]['location']['#description'] = t('Enter as much of your address as you are comfortable with. Your address will only be viewable by those who have the appropriate permissions. The site will be able to automatically link you to driving directions and other features if it already knows your address.'); - + if (user_access('submit latitude/longitude')) { + $loc = array('latitude'=>'', 'longitude' => ''); + if (isset($user->location)) { + $loc = $user->location; + } + $form[0]['location'] = array_merge($form[0]['location'], location_latlon_form(t('If you wish to supply your own latitude/longitude, you may do so here. Leaving these fields blank means that the system will determine a latitude/longitude for you, if possible.'), $loc)); + } if ($user->location['lid']) { $form[0]['location']['lid'] = array( '#type' => 'hidden', @@ -1431,8 +1437,12 @@ function location_user($op, &$edit, &$us else { $edit['location'] = location_form2api($edit['location']); } - - if ($data = location_latlon_exact($edit['location'])) { + if (isset($edit['location']['latitude']) && isset($edit['location']['longitude']) && $edit['location']['latitude'] && $edit['location']['longitude']) { + $edit['location']['source'] = LOCATION_LATLON_USER_SUBMITTED; + $edit['location']['lat'] = $edit['location']['latitude']; + $edit['location']['lon'] = $edit['location']['longitude']; + } + elseif ($data = location_latlon_exact($edit['location'])) { $edit['location']['source'] = LOCATION_LATLON_GEOCODED_EXACT; $edit['location']['lat'] = $data['lat']; $edit['location']['lon'] = $data['lon'];