db_query("UPDATE {location} SET latitude='%f', longitude='%f', source='%d' WHERE oid='%d' AND type='user'",$edit['gmap_latitude'],$edit['gmap_longitude'],1,$user->uid);
}
else{
db_query("UPDATE {location} SET latitude=null, longitude=null, source='%d' WHERE oid='%d' AND type='user'",0,$user->uid);
$form2 = form_textfield(t('Latitude'), 'gmap_latitude', $user->latitude, 30,120, t('The latitude will automatically be entered here (or you can do it manually).'), array('onchange'=>'gmap_textchange();') );
$form2 .= form_textfield(t('Longitude'), 'gmap_longitude', $user->longitude, 30,120, t('The longitude will automatically be entered here (or you can do it manually).'), array('onchange'=>'gmap_textchange();') );
$form['initialization']['googlemap_api_key']=array('#type'=>'textfield','#title'=>t('Google map API key'),'#default_value'=>variable_get('googlemap_api_key',''),'#size'=>50,'#maxlength'=>255,'#description'=>t('Your personal Googlemaps API key. You must get this for each separate website at <a href="http://www.google.com/apis/maps/">Google Map API website</a>.'));
$form['initialization']['gmap_method']=array('#type'=>'select','#title'=>t('Google map method'),'#options'=>array('Static'=>t('Static'),'Dynamic'=>t('Dynamic'),'None'=>t('None')),'#default_value'=>GMAP_LOAD_METHOD,'#description'=>t('How is the Google Map initialization script run:<br /><strong>Static</strong> - Loaded on every page, <br /><strong>Dynamic</strong> - Initialization script runs only on pages with google maps, but all pages with the gmap filter will not be cached. <br /><strong>None</strong> - Google map initialization script must be loaded some other way.'));
// xmaps not compatible with v2 of the Google Map API
// $form['initialization']['gmap_xmaps']=array('#type'=>'checkbox', '#title'=>t('Enable Xmaps features (circles and polygons)'), '#default_value'=>GMAP_XMAPS,'#description'=>t('Enables XMaps features. XMaps is currently a <em>beta</em> release available from <a href="http://xmaps.busmonster.com/">xmaps.busmonser.com</a>. '));
$form['initialization']['gmap_cluster']=array('#type'=>'checkbox','#title'=>t('Enable clusterer.js'),'#default_value'=>GMAP_CLUSTER,'#description'=>t('Enables Jef Poskanzer\'s excellent <a href="http://www.acme.com/javascript/#Clusterer">clusterer.js</a> script. (useful for a large number of markers on a single map)'));
'#description'=>t('Your personal Googlemaps API key. You must get this for each separate website at <a href="http://www.google.com/apis/maps/">Google Map API website</a>.'),
'#description'=>t('How is the Google Map initialization script run:<br /><strong>Static</strong> - Loaded on every page, <br /><strong>Dynamic</strong> - Initialization script runs only on pages with google maps, but all pages with the gmap filter will not be cached. <br /><strong>None</strong> - Google map initialization script must be loaded some other way.'),
);
// xmaps not compatible with v2 of the Google Map API
/*
$form['initialization']['gmap_xmaps']=array(
'#type'=>'checkbox',
'#title'=>t('Enable Xmaps features (circles and polygons)'),
'#default_value'=>GMAP_XMAPS,
'#description'=>t('Enables XMaps features. XMaps is currently a <em>beta</em> release available from <a href="http://xmaps.busmonster.com/">xmaps.busmonser.com</a>. '),
'#description'=>t('Enables Jef Poskanzer\'s excellent <a href="http://www.acme.com/javascript/#Clusterer">clusterer.js</a> script. (useful for a large number of markers on a single map)'),
$form['defaults']['gmap_default_width']=array('#type'=>'textfield','#title'=>t('Default width'),'#default_value'=>GMAP_WIDTH,'#size'=>25,'#maxlength'=>6,'#description'=>t('The default width of a Google map.'));
$form['defaults']['gmap_default_height']=array('#type'=>'textfield','#title'=>t('Default height'),'#default_value'=>GMAP_HEIGHT,'#size'=>25,'#maxlength'=>6,'#description'=>t('The default height of a Google map.'));
'#description'=>t('The default width of a Google map.'),
);
$form['defaults']['gmap_default_height']=array(
'#type'=>'textfield',
'#title'=>t('Default height'),
'#default_value'=>GMAP_HEIGHT,
'#size'=>25,
'#maxlength'=>6,
'#description'=>t('The default height of a Google map.'),
);
$form['defaults']['gmap_default_latlong']=array(
'#type'=>'textfield',
'#title'=>t('Default center'),
'#default_value'=>GMAP_LONGLAT,
'#description'=>'The decimal latitude,longitude of the centre of the map. The "." is used for decimal, and "," is used to separate latitude and longitude.',
'#size'=>50,'#maxlength'=>255,'#description'=>t('The default longitude, latitude of a Google map.'));
$form['defaults']['gmap_default_zoom']=array('#type'=>'select','#title'=>t('Default zoom'),'#default_value'=>GMAP_ZOOM,'#options'=>drupal_map_assoc(range(0,17)),'#description'=>t('The default zoom level of a Google map.'));
$form['defaults']['gmap_default_control']=array('#type'=>'select','#title'=>t('Default control type'),'#default_value'=>GMAP_CONTROL,'#options'=>array('None'=>t('None'),'Small'=>t('Small'),'Large'=>t('Large')));
$form['defaults']['gmap_default_line1_color']=array('#type'=>'textfield','#title'=>t('Default Line 1 Color'),'#default_value'=>GMAP_LINECOLOR1,'#size'=>25,'#maxlength'=>7);
$form['defaults']['gmap_default_line2_color']=array('#type'=>'textfield','#title'=>t('Default Line 2 Color'),'#default_value'=>GMAP_LINECOLOR2,'#size'=>25,'#maxlength'=>7);
$form['defaults']['gmap_default_line3_color']=array('#type'=>'textfield','#title'=>t('Default Line 3 Color'),'#default_value'=>GMAP_LINECOLOR3,'#size'=>25,'#maxlength'=>7);