Index: /extensions/rv_gmaps/trunk/admin/admin.php
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/admin/admin.php	(revision 26331)
@@ -14,5 +14,4 @@
 $tabsheet = new tabsheet();
 $tabsheet->add( 'config', 'Configuration', add_url_params( $my_base_url, array('tab'=>'config') ) );
-$tabsheet->add( 'sync', 'Synchronize', add_url_params( $my_base_url, array('tab'=>'sync') ) );
 $tabsheet->select($page['tab']);
 
Index: /extensions/rv_gmaps/trunk/admin/admin_boot.php
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_boot.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/admin/admin_boot.php	(revision 26331)
@@ -31,7 +31,7 @@
 {
 	if ($prefilter==="geotagged")
-		$query = 'lat IS NOT NULL AND lon IS NOT NULL';
+		$query = 'latitude IS NOT NULL AND longitude IS NOT NULL';
 	elseif ($prefilter==="not geotagged")
-		$query = 'lat IS NULL OR lon IS NULL';
+		$query = 'latitude IS NULL OR longitude IS NULL';
 
 	if ( isset($query) )
@@ -74,10 +74,10 @@
 		if ( (double)$lat<=90 and (double)$lat>=-90
 				and (double)$lon<=180 and (double)$lon>=-180 )
-			$update_query = 'lat='.$lat.', lon='.$lon;
+			$update_query = 'latitude='.$lat.', longitude='.$lon;
 		else
 			$page['errors'][] = 'Invalid lat or lon value';
 	}
 	elseif ( strlen($lat)==0 and strlen($lon)==0 )
-		$update_query = 'lat=NULL, lon=NULL';
+		$update_query = 'latitude=NULL, longitude=NULL';
 	else
 		$page['errors'][] = 'Both lat/lon must be empty or not empty';
@@ -124,15 +124,15 @@
     $data = array(
       'id' => $row['id'],
-      'lat' => trim($_POST['lat-'.$row['id']]),
-      'lon' => trim($_POST['lon-'.$row['id']])
+      'latitude' => trim($_POST['lat-'.$row['id']]),
+      'longitude' => trim($_POST['lon-'.$row['id']])
     );
 
-    if ( strlen($data['lat'])>0 and strlen($data['lon'])>0 )
+    if ( strlen($data['latitude'])>0 and strlen($data['longitude'])>0 )
     {
-      if ( (double)$data['lat']>90 or (double)$data['lat']<-90
-          or (double)$data['lon']>180 or (double)$data['lon']<-180 )
+      if ( (double)$data['latitude']>90 or (double)$data['latitude']<-90
+          or (double)$data['longitude']>180 or (double)$data['longitude']<-180 )
         $error = true;
     }
-    elseif ( strlen($data['lat'])==0 and strlen($data['lon'])==0 )
+    elseif ( strlen($data['latitude'])==0 and strlen($data['longitude'])==0 )
     {
       // nothing
@@ -153,5 +153,5 @@
     array(
       'primary' => array('id'),
-      'update' => array('lat', 'lon')
+      'update' => array('latitude', 'longitude')
       ),
     $datas
@@ -183,8 +183,8 @@
       <td>
         <label>{\'Latitude\'|@translate}
-          <input type="text" size="8" name="lat-{$element.id}" value="{$element.lat}">
+          <input type="text" size="8" name="lat-{$element.id}" value="{$element.latitude}">
         </label>
         <label>{\'Longitude\'|@translate}
-          <input type="text" size="9" name="lon-{$element.id}" value="{$element.lon}">
+          <input type="text" size="9" name="lon-{$element.id}" value="{$element.longitude}">
         </label>
       </td>
Index: /extensions/rv_gmaps/trunk/admin/admin_config.php
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_config.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/admin/admin_config.php	(revision 26331)
@@ -17,16 +17,4 @@
   }
 
-  if (isset($_POST['gmaps_auto_sync']))
-  {
-    conf_update_param('gmaps_auto_sync', "1");
-    $conf['gmaps_auto_sync']=1;
-  }
-  else
-  {
-    $query = 'DELETE FROM '.CONFIG_TABLE.' WHERE param="gmaps_auto_sync"';
-    pwg_query($query);
-    unset($conf['gmaps_auto_sync']);
-  }
-  
   $gm_config = rvm_get_config();
 
@@ -52,5 +40,5 @@
 }
 
-$query = 'SELECT COUNT(*) FROM '.IMAGES_TABLE.' WHERE lat IS NOT NULL';
+$query = 'SELECT COUNT(*) FROM '.IMAGES_TABLE.' WHERE latitude IS NOT NULL';
 list($nb_geotagged) = pwg_db_fetch_array( pwg_query($query) );
 
@@ -59,5 +47,4 @@
       'NB_GEOTAGGED' => $nb_geotagged,
       'GMAPS_API_KEY' => $conf['gmaps_api_key'],
-      'GMAPS_AUTO_SYNC' => isset($conf['gmaps_auto_sync']) ? 1:0,
       'NB_MARKERS' => rvm_get_config_var('nb_markers',40),
       'NB_IMAGES_PER_MARKER' => rvm_get_config_var('nb_images_per_marker',20),
Index: /extensions/rv_gmaps/trunk/admin/admin_config.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_config.tpl	(revision 26330)
+++ /extensions/rv_gmaps/trunk/admin/admin_config.tpl	(revision 26331)
@@ -16,5 +16,5 @@
 	<br/> -->
 
-	<li>
+	<!--<li>
 	 <label>
 		Automatically sync from exif
@@ -23,5 +23,5 @@
 		<br/><small>When metadata is synchronized, tour manual set coordinates might be overriden.</small>
 	</li>
-	<br/>
+	<br/> -->
 
   <li>
Index: tensions/rv_gmaps/trunk/admin/admin_sync.php
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_sync.php	(revision 26330)
+++ 	(revision )
@@ -1,111 +1,0 @@
-<?php
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-if ( isset($_POST['submit']) )
-  $sync_options = array(
-    'simulate' => isset($_POST['simulate']),
-    'cat_id' => isset($_POST['cat_id']) ? (int)$_POST['cat_id'] : 0,
-    'subcats_included' => isset($_POST['subcats_included']),
-    );
-else
-  $sync_options = array(
-    'simulate' => true,
-    'cat_id' => 0,
-    'subcats_included' => true,
-    );
-
-
-if ( isset($_POST['submit']) )
-{
-	include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
-  include_once( dirname(__FILE__).'/../include/functions_metadata.php' );
-  $where_clauses = array();
-  if ( $sync_options['cat_id']!=0 )
-  {
-    $query='
-SELECT id FROM '.CATEGORIES_TABLE.'
-  WHERE ';
-    if ( $sync_options['subcats_included'])
-      $query .= 'uppercats REGEXP \'(^|,)'.$sync_options['cat_id'].'(,|$)\'';
-    else
-      $query .= 'id='.$sync_options['cat_id'];
-    $cat_ids = array_from_query($query, 'id');
-
-    $query='
-SELECT id,path,lat,lon
-  FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id=image_id
-  WHERE category_id IN ('.implode(',', $cat_ids).')
-  GROUP BY id';
-  }
-  else
-  {
-    $query='
-SELECT id,path,lat,lon
-  FROM '.IMAGES_TABLE;
-  }
-
-  $images = hash_from_query( $query, 'id');
-  $datas = array();
-  $errors = array();
-  foreach ($images as $image)
-  {
-		$filename = $image['path'];
-		$exif = @read_exif_data( $filename );
-		if ( empty($exif) )
-			continue;
-		$ll = exif_to_lat_lon($exif);
-		if (!is_array($ll))
-		{
-			if (!empty($ll))
-				$errors[] = $filename. ': '.$ll;
-			continue;
-		}
-
-		$datas[] = array (
-			'id' => $image['id'],
-			'lat' => $ll[0],
-			'lon' => $ll[1],
-			);
-  }
-  $template->assign( 'sync_errors', $errors );
-
-  if ( count($datas)>0 and !$sync_options['simulate'] )
-  {
-    mass_updates(
-        IMAGES_TABLE,
-        array(
-          'primary' => array('id'),
-          'update'  => array('lat', 'lon')
-        ),
-        $datas
-      );
-    rvm_invalidate_cache();
-  }
-
-  $template->assign(
-    'metadata_result',
-    array(
-      'NB_ELEMENTS_DONE' => count($datas),
-      'NB_ELEMENTS_CANDIDATES' => count($images),
-      'NB_ERRORS' => count($errors),
-      ));
-
-}
-
-
-$query = '
-SELECT id,
-  CONCAT(name, IF(dir IS NULL, " (V)", "") ) AS name,
-  uppercats, global_rank
-  FROM '.CATEGORIES_TABLE;
-display_select_cat_wrapper($query,
-                           array( $sync_options['cat_id'] ),
-                           'categories',
-                           false);
-$template->assign(
-    array(
-      'SUBCATS_INCLUDED_CHECKED' => $sync_options['subcats_included'] ? 'checked="checked"' : '',
-    )
-  );
-
-?>
Index: tensions/rv_gmaps/trunk/admin/admin_sync.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_sync.tpl	(revision 26330)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<p>Synchronization of EXIF gps metadata information with the database.</p>
-
-{if isset($metadata_result)}
-<h3>{'Metadata synchronization results'|@translate}</h3>
-<ul>
-	<li>{$metadata_result.NB_ELEMENTS_DONE} {'photos updated in the database'|@translate}</li>
-	<li>{$metadata_result.NB_ELEMENTS_CANDIDATES} {'photos candidates for metadata synchronization'|@translate}</li>
-	<li>{$metadata_result.NB_ERRORS} {'errors during synchronization'|@translate}</li>
-</ul>
-{/if}
-
-{if not empty($sync_errors)}
-<h3>{'Error list'|@translate}</h3>
-<div class="errors">
-<ul>
-  {foreach from=$sync_error item=error}
-	<li>{$error}</li>
-	{/foreach}
-</ul>
-</div>
-{/if}
-
-<form action="" method="post" id="update">
-
-  <fieldset id="syncOptions">
-    <legend>synchronization options</legend>
-    <ul>
-      <li><label><input type="checkbox" name="simulate" value="1" checked="checked" /> {'only perform a simulation (no change in database will be made)'|@translate}</label></li>
-    </ul>
-  </fieldset>
-
-  <fieldset id="catSubset">
-    <legend>{'reduce to single existing albums'|@translate}</legend>
-    <ul>
-    <li>
-    <select class="categoryList" name="cat_id" size="10">
-    	{html_options options=$categories selected=$categories_selected}
-    </select>
-    </li>
-
-    <li><label><input type="checkbox" name="subcats_included" value="1" {$SUBCATS_INCLUDED_CHECKED} /> {'Search in sub-albums'|@translate}</label></li>
-    </ul>
-  </fieldset>
-
-  <p>
-    <input type="submit" value="{'Submit'|@translate}" name="submit">
-  </p>
-</form>
Index: /extensions/rv_gmaps/trunk/include/functions.php
===================================================================
--- /extensions/rv_gmaps/trunk/include/functions.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/include/functions.php	(revision 26331)
@@ -29,5 +29,5 @@
   $query = '
 SELECT id FROM '.IMAGES_TABLE.'
-WHERE lat IS NOT NULL
+WHERE latitude IS NOT NULL
   AND id IN ('.implode(',', $items).')
 ORDER BY NULL
Index: /extensions/rv_gmaps/trunk/include/functions_map.php
===================================================================
--- /extensions/rv_gmaps/trunk/include/functions_map.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/include/functions_map.php	(revision 26331)
@@ -129,10 +129,10 @@
   if ( !isset($b) or empty($b) )
     return null;
-  $sql_where = 'i.lat BETWEEN '.$b['s'].' AND '.($b['n']);
+  $sql_where = 'i.latitude BETWEEN '.$b['s'].' AND '.($b['n']);
   $sql_where .= ' AND ';
   if ($b['e'] >= $b['w'])
-    $sql_where .= 'i.lon BETWEEN '.$b['w'].' AND '.($b['e']);
+    $sql_where .= 'i.longitude BETWEEN '.$b['w'].' AND '.($b['e']);
   else
-    $sql_where .= 'i.lon NOT BETWEEN '.($b['e']+1e-7).' AND '.($b['w']-1e-7);
+    $sql_where .= 'i.longitude NOT BETWEEN '.($b['e']+1e-7).' AND '.($b['w']-1e-7);
   return $sql_where;
 }
@@ -172,5 +172,5 @@
   if ($bounds['e']>180) $bounds['e']-=360;
   $where_sql = rvm_bounds_to_sql( $bounds );
-  $order_by = 'ORDER BY POW('.$ll['lat'].'-i.lat,2)+POW('.$cos_lat.'*('.$ll['lon'].'-i.lon),2)';
+  $order_by = 'ORDER BY POW('.$ll['lat'].'-i.latitude,2)+POW('.$cos_lat.'*('.$ll['lon'].'-i.longitude),2)';
   return $where_sql;
 }
@@ -300,5 +300,5 @@
 
   $query = '
-SELECT category_id cat_id, uppercats, MAX(lat) AS n, MIN(lat) AS s, MAX(lon) AS e, MIN(lon) AS w, COUNT(i.id) count, MIN(i.date_creation) min_date, MAX(i.date_creation) max_date
+SELECT category_id cat_id, uppercats, MAX(latitude) AS n, MIN(latitude) AS s, MAX(longitude) AS e, MIN(longitude) AS w, COUNT(i.id) count, MIN(i.date_creation) min_date, MAX(i.date_creation) max_date
   FROM
     '.CATEGORIES_TABLE.' as c
@@ -369,5 +369,5 @@
 
   if (empty($where_sql))
-    $where_sql .= 'i.lat IS NOT NULL';
+    $where_sql .= 'i.latitude IS NOT NULL';
   $where_sql_images_only = $where_sql;
   $where_sql .= get_sql_condition_FandF(
Index: /extensions/rv_gmaps/trunk/include/picture_map.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/include/picture_map.inc.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/include/picture_map.inc.php	(revision 26331)
@@ -36,14 +36,14 @@
 			'MAP_TYPE' => rvm_get_config_var('map_type', 'ROADMAP'),
       'U_NO_MAP' => duplicate_picture_url(),
-      'U_BLOWUP' => rvm_make_blowup_url( array('ll'=>$picture), array('start','box') ),
+      'U_BLOWUP' => rvm_make_blowup_url( array('ll'=> array('lat'=>$picture['latitude'],'lon'=>$picture['longitude'])), array('start','box') ),
       'COMMENT_IMG' => trigger_event('render_element_description', $picture['comment'])
     )
   );
-  if ( isset($picture['lat']) )
+  if ( isset($picture['latitude']) )
   {
     $template->assign( 'coordinates',
         array(
-          'LAT' => $picture['lat'],
-          'LON' => $picture['lon'],
+          'LAT' => $picture['latitude'],
+          'LON' => $picture['longitude'],
         )
       );
Index: /extensions/rv_gmaps/trunk/kml.php
===================================================================
--- /extensions/rv_gmaps/trunk/kml.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/kml.php	(revision 26331)
@@ -44,5 +44,5 @@
 
 
-$img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.lat,i.lon,i.date_creation';
+$img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.latitude AS lat,i.longitude AS lon,i.date_creation';
 
 rvm_build_section_items($img_fields, $where_sql, RVM_BUILD_ARRAY, $order_by);
Index: /extensions/rv_gmaps/trunk/main.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/main.inc.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/main.inc.php	(revision 26331)
@@ -21,10 +21,4 @@
 
 global $conf;
-if (@$conf['gmaps_auto_sync'])
-{
-  $conf['use_exif_mapping']['lat'] = 'lat';
-  $conf['use_exif_mapping']['lon'] = 'lon';
-  add_event_handler('format_exif_data', 'rvm_format_exif', EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
-}
 
 function rvm_index_cat_thumbs_displayed()
@@ -90,8 +84,8 @@
 function rvm_picture_pictures_data($pictures)
 {
-	if ( isset($pictures['current']['lat']) and isset($pictures['current']['lon']) )
+	if ( isset($pictures['current']['latitude']) and isset($pictures['current']['longitude']) )
 	{
 		global $template;
-		$template->append('head_elements', '<meta name=geo.position content='.$pictures['current']['lat'].';'.$pictures['current']['lon'].'>' );
+		$template->append('head_elements', '<meta name=geo.position content='.$pictures['current']['latitude'].';'.$pictures['current']['longitude'].'>' );
 		include_once( dirname(__FILE__) .'/include/functions.php');
 		rvm_load_language();
@@ -132,19 +126,4 @@
 }
 
-function rvm_format_exif($exif, $file, $map)
-{
-  if (isset($map['lat']))
-  {
-		include_once( dirname(__FILE__) .'/include/functions_metadata.php');
-		$ll = exif_to_lat_lon($exif);
-		if (is_array($ll))
-		{
-			$exif[$map['lat']] = $ll[0];
-			$exif[$map['lon']] = $ll[1];
-		}
-  }
-  return $exif;
-}
-
 if (defined('IN_ADMIN')) {
 	include_once(dirname(__FILE__).'/admin/admin_boot.php');
Index: /extensions/rv_gmaps/trunk/maintain.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/maintain.inc.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/maintain.inc.php	(revision 26331)
@@ -1,17 +1,16 @@
 <?php
+function rvgm_drop_old_columns()
+{
+  $q = '
+ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `lat`';
+  pwg_query( $q );
+
+  $q = '
+ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `lon`';
+  pwg_query( $q );
+}
+
 function plugin_install()
 {
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lat` DOUBLE(8,6)';
-  pwg_query($q);
-  
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' ADD INDEX images_lat(`lat`)';
-  pwg_query($q);
-
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lon` DOUBLE(9,6)';
-  pwg_query($q);
-  
   $q = '
 INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
@@ -25,4 +24,10 @@
 {
   global $conf;
+
+  $query = 'SHOW COLUMNS FROM '. IMAGES_TABLE .' LIKE "latitude";';
+
+  if (pwg_db_num_rows(pwg_query($query)))
+		rvgm_drop_old_columns();
+	pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN("gmaps_auto_sync")');
 
   if (!isset($conf['rv_gmaps_add_map.php']) or $conf['rv_gmaps_add_map.php'])
@@ -68,11 +73,5 @@
 function plugin_uninstall()
 {
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `lat`';
-  pwg_query( $q );
-
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `lon`';
-  pwg_query( $q );
+  rvgm_drop_old_columns();
 
   $q = '
Index: /extensions/rv_gmaps/trunk/map.php
===================================================================
--- /extensions/rv_gmaps/trunk/map.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/map.php	(revision 26331)
@@ -50,5 +50,5 @@
 if ( !isset($_GET['ll']) /*and ($page['section']!='categories' or isset($page['category']) )*/ )
 {
-  $img_fields = 'MIN(i.lat) s, MIN(i.lon) w, MAX(i.lat) n, MAX(i.lon) e';
+  $img_fields = 'MIN(i.latitude) s, MIN(i.longitude) w, MAX(i.latitude) n, MAX(i.longitude) e';
   $page['flat']=true;
   rvm_build_section_items($img_fields, null, RVM_BUILD_AGGREGATE);
Index: /extensions/rv_gmaps/trunk/map_data.php
===================================================================
--- /extensions/rv_gmaps/trunk/map_data.php	(revision 26330)
+++ /extensions/rv_gmaps/trunk/map_data.php	(revision 26331)
@@ -31,5 +31,5 @@
 $where_sql = rvm_bounds_to_sql( $page['box'] );
 
-$img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.lat,i.lon,i.width,i.height,i.rotation';
+$img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.latitude AS lat,i.longitude AS lon,i.width,i.height,i.rotation';
 
 $was_flat = @$page['flat'];
