Index: /extensions/edit_gmaps/admin/admin_edit.php
===================================================================
--- /extensions/edit_gmaps/admin/admin_edit.php	(revision 8455)
+++ /extensions/edit_gmaps/admin/admin_edit.php	(revision 8456)
@@ -1,4 +1,8 @@
 <?php 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+if (!defined('EDIT_RV_ROOT')) 
+define(  'EDIT_RV_ROOT',  PHPWG_PLUGINS_PATH.'edit_gmaps/admin/' );
+
 global $lang;
 load_language('lang', dirname(__FILE__).'/../');
@@ -35,4 +39,10 @@
 
 $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d element', '%d elements', count($page['cat_elements_id'])).' - '.$page['title']);
+
+
+$template->assign(
+  						array( 						
+						'EDIT_RV_ROOT' => EDIT_RV_ROOT)
+						 );
 
  
@@ -99,6 +109,10 @@
 	    unset($collection);
  }
+
+  
+
  if ($_POST['submit']==l10n('search_title' ))
   {  
+
   $match  = $_POST['match'] ;
 
@@ -203,9 +217,8 @@
 {   
     $lat =1000;
-
+	
 if ($match<>"" && $match<>"/" )
 {   
 $match=str_replace(" ","+",$match);
-
        $src="http://maps.google.com/maps/geo?q=".$match."&output=xml&sensor=true_or_false&key=".$conf['gmaps_api_key'];
 //json,kml,xml,csv
@@ -216,6 +229,12 @@
 		$lat=$location[1];
 		$lon=$location[0];
+
   				$template->assign(	array('lat' => $lat ,
 	  						              'lon' => $lon ,));
+				$template->assign( 'coordinates',
+				                   array('LAT' => $lat,
+										 'LON' => $lon,
+										)
+									);
    }
 									
@@ -225,11 +244,15 @@
    			if (array_search($id_0,$image)) {
 			 if ($lat==1000) {
-			    $lat= ($image['lat'] <> '') ? $image['lat'] : '49.0'  ;
+			    $lat= ($image['lat'] <> '') ? $image['lat'] : '100'  ;
 				$lon= ($image['lon']  <> '') ? $image['lon'] : '3.0'  ;
- 				$template->assign(	array('lat' => $lat ,
-	  						              'lon' => $lon ,
-							      )
-				);
-			}
+
+ 				$template->assign(	array('zoom' => 4,'lat' => $lat , 'lon' => $lon , )	);
+				$template->assign( 'coordinates',
+				                   array('LAT' => $lat,
+										 'LON' => $lon,
+										)
+									);
+
+				}
  		  
 			 $tpl_var = array_merge( 
Index: /extensions/edit_gmaps/admin/admin_edit.tpl
===================================================================
--- /extensions/edit_gmaps/admin/admin_edit.tpl	(revision 8455)
+++ /extensions/edit_gmaps/admin/admin_edit.tpl	(revision 8456)
@@ -1,24 +1,12 @@
 {html_head}
-{* $Id: info_deroulante.tpl 3723 2009-08-07 04:53:38Z rvelices $ *}
+{* $Id: admin_edit.tpl  2011-01-03   *}
 
-{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.cluetip.js"}
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" } 
+{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
+{known_script id="EDIT_RV_script" src=$EDIT_RV_ROOT|@cat:"js/JScript.js"}
+ 
 
-
-<script type="text/javascript">
-jQuery().ready(
-  function(){ldelim}
-  jQuery('.cluetip').cluetip({ldelim}
-    width: 300,
-    splitTitle: '|'
-   }
-  );
- }
-);
-</script>
-
-{if $lat}
-<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={$GMAPS_API_KEY}&amp;hl={$lang_info.code}" type="text/javascript"></script>
- 
-<script src="plugins/rv_gmaps/template/windows_13/javascripts/prototype.js" type="text/javascript"></script>
+<script src="http://maps.google.com/maps/api/js?sensor=false&amp;hl={$lang_info.code}" type="text/javascript"></script>
+<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
 
 
@@ -46,5 +34,7 @@
 {/literal}
 </style>
-{/if}
+
+
+
 {/html_head}
 
@@ -80,6 +70,6 @@
 
 <form action="" method="post" id="Envoie" name="Envoie"   >
-
-<fieldset>
+{if !$lat}
+<fieldset  >
 	<legend>{'Elements'|@translate}</legend>
 
@@ -108,6 +98,6 @@
 	{/if}
 </fieldset>
-
-<!--/===================================================================================-->
+{/if}
+ 
 
 <fieldset>
@@ -117,25 +107,28 @@
 <input class="cluetip" title="{'reset'|@translate}|{'hlp_line4'|@translate}."  type="submit" name="submit" value="{'reset'|@translate}" /><br />
 
-<input class="cluetip" title="{'search_title'|@translate}|{'hlp_line6'|@translate}."  type="submit" name="submit" value="{'search_title'|@translate}" />
-<input class="cluetip" title="{'lieu'|@translate}|{'hlp_line5'|@translate}." type="text" size="70"   value="{$match}"  name="match"    />
+<input class="cluetip" title="{'search_title'|@translate}|{'hlp_line6'|@translate}."  type="submit" name="submit" value="{'search_title'|@translate}"  onclick="codeAddress()"  />
+<input class="cluetip" title="{'lieu'|@translate}|{'hlp_line5'|@translate}." type="text" size="70"   value="{$match}"  name="match"      />
+
 {if $lat}
-<div id="map"></div>
-{if not empty($Selectthumbnails)}
-	<ul class="thumbnails">
-		{foreach from=$Selectthumbnails item=thumbnail}
-		 
+<fieldset>
+<table>
+<td><div id="markerStatus"></div></td>
+<td><div id="markerAdress"></div></td>
+</table>
+
+
+    <div id="map"></div>
+    {if not empty($Selectthumbnails)}
+	    <ul class="thumbnails">
+		    {foreach from=$Selectthumbnails item=thumbnail}		 
 			<li><span class="wrap1">
 				<label>
 					<span class="wrap2"><span>
 						<img src="{$thumbnail.U_TN}" alt="{$thumbnail.file}" title="{$thumbnail.TITLE}" class="thumbnail" />
-					</span>
-					
+					</span>					
 					</span>
 					<br/>
-</label>
-				<input type="hidden"  value={$thumbnail.id}  name="selection[]"    />
-				
-				
-				
+                </label>
+				<input type="hidden"  value={$thumbnail.id}  name="selection[]"    />				
 				<span class="thumbLegend">
 				{if isset($thumbnail.U_MAP)}
@@ -150,176 +143,56 @@
 		{/foreach}
 	</ul>
-	{/if}
+	{/if} 
+             <script type="text/javascript"> 
+            {if isset($coordinates) && $coordinates.LAT != 100 }
+		         var   coordinates={ldelim} LAT:{$coordinates.LAT},LON:{$coordinates.LON} };
+            {else}
+		         var  coordinates={ldelim} LAT:100,LON:100 };  
+            {/if} 
+           
+             
+ 
 
- <script src="dragzoom.js" type="text/javascript"></script>
-<script type="text/javascript">
+            Event.observe(window, 'load', onLoad );
+            if (typeof $Moot == "undefined") $Moot = [];
+             $Moot.push(Window.$);
+           
+           
+            </script>
 
-{literal}
- //<![<!--CDATA[
- var map;
-var	 controleMiniCarte ;
-function ajoutControle(newZoom){
+</fieldset>
+{/if}
 
-if (newZoom < 5) return ;
+        <fieldset>
+          <legend>{'Form'|@translate}</legend> 
+          <label>Latitude (-90=S to 90=N)
+            <input type="text" size="8" value="{$lat}"  name="lat" />
+          </label>
+          <label>Longitude (-180=E to 180=W)
+            <input type="text" size="9"value="{$lon}"  name="lon"  />
+          </label>  
+          <p>
+            {'target'|@translate}
+            <label><input type="radio" name="target" value="all" /> {'all'|@translate}</label>
+            <label><input type="radio" name="target" value="selection" checked="checked" /> {'selection'|@translate}</label>
+          </p>
 
- var vt1=typeof(controleMiniCarte) ;
-if (vt1=="undefined"   ) {
+          <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$tag_input_enabled} /></p>
+        </fieldset>
 
-  controleMiniCarte = new google.maps.OverviewMapControl(new google.maps.Size(300,200));
- // controleMiniCarte.setMapType(G_PHYSICAL_MAP);
-  map.addControl(controleMiniCarte);
-  
-      }  
-}
-
-function onLoad()
-{
-  if (!GBrowserIsCompatible())   return;
-  var mapElement = document.getElementById("map");
-  map = new GMap2(document.getElementById("map"),{mapTypes: [G_SATELLITE_MAP,G_HYBRID_MAP,G_NORMAL_MAP,G_PHYSICAL_MAP,G_SATELLITE_3D_MAP]});
-  	map.addControl(new GLargeMapControl3D());
-  
-  map.addControl(new GMapTypeControl());
-  map.addControl(new GScaleControl());
-<!--  map.enableScrollWheelZoom();-->
-<!--  map.enableDoubleClickZoom();-->
-{/literal}
-{if isset($lat)}{/if}
-var coord = new GLatLng( {$lat}, {$lon} );
-
-  Ma_position=coord;
-  var echelle=18; 
-if ({$lat}=='49' && {$lon}=='3' )   echelle=4; 
-  
-  map.setCenter( coord, echelle);
-
-   var marker = new GMarker(coord,  {ldelim} draggable: true});
-  
-
-  
-  map.addOverlay(marker);
-
-{literal}
-  if ( !map.isLoaded() )    map.setCenter( new GLatLng(49,3), 4);
- try {
-    // the overview must be added after setting map center
-    //var ovcontrol = new GOverviewMapControl(new GSize(165,165));
-//		map.addControl(ovcontrol);
-	    GEvent.addListener(map, "zoomend", function() { 
-		     var	newZoom = map.getZoom();
- 	         ajoutControle(newZoom);
-			} );
-		GEvent.addListener(map, 'maptypechanged', function(){
-           if (typeof(controleMiniCarte)!="undefined"   ) {
-             var ov_map = controleMiniCarte.getOverviewMap();
-			if (ov_map) ov_map.setMapType(map.getCurrentMapType() );
-			}
-		});
-		}
-  catch(e){ alert( e.message ); }
- 
-GEvent.addListener(marker, "dragstart", function(overlay,latlng) {
-   marker.closeInfoWindow(); 
-		});
-		
-GEvent.addListener(marker, "dragend", function() {
-var latlng = marker.getPoint();
-
-  /*          var myHtml = "Nouvelle position:"+  "<input    type=\"text\" name=\"lat\" value="+latlng.lat()+" /><input   type=\"text\" name=\"lon\" value="+latlng.lng()+" /> ";	
-             map.openInfoWindow(latlng, myHtml);	
-*/
- 				document.Envoie.lat.value=latlng.lat() ;
-				document.Envoie.lon.value=latlng.lng() ; 
-  }); 
-GEvent.addListener(map,"click", function(overlay,latlng)
-            {
- if (overlay) { return; }
-            var myHtml = "<input    type=\"text\" name=\"lat\" value="+latlng.lat()+" /><input   type=\"text\" name=\"lon\" value="+latlng.lng()+" /> ";	
-             map.openInfoWindow(latlng, myHtml);	
-
-		{/literal}
-				document.Envoie.lat.value=latlng.lat() ;
-				document.Envoie.lon.value=latlng.lng() ;
-
-				
-				
+</fieldset>
+</form>
 
 
-		{literal}	
-            }
-			);
-			 
-				 
-
-  
-
-}
-
-function blowupUrl(theUrl)
-{
-  var win = new Window({
-    title: document.title,
-    url: theUrl,
-    classname: "alphacube",
-    left: 0, top: 0,
-    width:"640", height:"480",
-    minimizable: false,
-    maximizable: false,
-    draggable: false,
-    resizable: false,
-    destroyOnClose: true,
-    hideEffect: Element.hide,
-    showEffectOptions: {duration:1.5}
-  });
-
-  win.setConstraint(true, {top:20, left:20, bottom:30, right:20} );
-  win.maximize();
-  win.showCenter(true, 20, 20);
- 
-  return false;
-}
-
-function $(element) {
-  if (arguments.length > 1) {
-    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
-      elements.push($(arguments[i]));
-    return elements;
-  }
-  if (Object.isString(element))
-    element = document.getElementById(element);
-  return Element.extend(element);
-}
-
- Event.observe(window, 'load', onLoad ); 
- Event.observe(window, 'unload', GUnload ); 
-//]-->]>
-{/literal}
- 
+<script type="text/javascript">
+jQuery().ready(
+  function(){ldelim}
+  jQuery('.cluetip').cluetip({ldelim}
+    width: 300,height:100,
+    splitTitle: '|'
+   }
+  );
+ }
+);
 </script>
 
-{/if}
-
-</fieldset>
-
-
-<fieldset>
-  <legend>{'Form'|@translate}</legend>
-
- 
-  <label>Latitude (-90=S to 90=N)
-    <input type="text" size="8" value="{$lat}"  name="lat" />
-  </label>
-  <label>Longitude (-180=E to 180=W)
-    <input type="text" size="9"value="{$lon}"  name="lon"  />
-  </label>
-  
-  <p>
-    {'target'|@translate}
-    <label><input type="radio" name="target" value="all" /> {'all'|@translate}</label>
-    <label><input type="radio" name="target" value="selection" checked="checked" /> {'selection'|@translate}</label>
-  </p>
-
-  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$tag_input_enabled} /></p>
-</fieldset>
-
-</form>
Index: /extensions/edit_gmaps/admin/js/JScript.js
===================================================================
--- /extensions/edit_gmaps/admin/js/JScript.js	(revision 8456)
+++ /extensions/edit_gmaps/admin/js/JScript.js	(revision 8456)
@@ -0,0 +1,213 @@
+﻿
+/* Déclaration des variables  */
+var geocoder;
+var map;
+var infowindow = new google.maps.InfoWindow();
+var marker;
+
+function onLoad()
+            {
+                geocoder = new google.maps.Geocoder();
+	            var mapElement = document.getElementById("map");
+             if  ( coordinates.LAT  <= 90 ) {
+                 LatLng = new google.maps.LatLng(coordinates.LAT, coordinates.LON);
+		            zoom = 18 ;
+             }else {
+		            LatLng = new google.maps.LatLng(49, 3);
+		            zoom = 3;
+		        }
+ 
+
+
+            /*
+             MapTypeId.ROADMAP affiche un plan (de type carte routière).
+             MapTypeId.SATELLITE affiche une vue satellite.
+             MapTypeId.HYBRID affiche une vue mixte entre les deux précédentes.
+             MapTypeId.TERRAIN affiche une vue du relief.
+            */
+ var mapOpts = {      
+                    center:LatLng,
+                    zoom:zoom,
+		            mapTypeId: google.maps.MapTypeId.SATELLITE 
+	            };
+	
+	            var map = new google.maps.Map( mapElement, mapOpts );
+
+	      
+
+
+         if (coordinates) 
+	            var marker = new google.maps.Marker( { 
+		            position: map.getCenter(),
+		            map: map,
+                    draggable: true 
+		            });
+
+
+                // Add dragging event listeners.    
+                google.maps.event.addListener(marker,
+        'dragstart',
+        function () {
+            updateMarkerAddress('Dragging...');
+        });
+
+        google.maps.event.addListener(marker,
+            'drag',
+            function () {
+                updateMarkerStatus('Dragging...');
+                updateMarkerPosition(marker.getPosition());
+            }
+            );
+
+            google.maps.event.addListener(marker,
+        'dragend',
+        function () {
+            updateMarkerStatus('Drag ended');
+            geocodePosition(marker.getPosition());
+           
+            }
+        );
+
+
+		        // Update current position info.    
+		       updateMarkerPosition(LatLng);
+		       geocodePosition(LatLng);
+	      
+	            return false;
+    
+
+            function blowupUrl(theUrl) {
+                var win = new Window({
+                    title: document.title,
+                    url: theUrl,
+                    classname: "alphacube",
+                    left: 0, top: 0,
+                    width: "640", height: "480",
+                    minimizable: false,
+                    maximizable: false,
+                    draggable: false,
+                    resizable: true,
+                    destroyOnClose: true,
+                    hideEffect: Element.hide,
+                    showEffectOptions: { duration: 1.5 }
+                })
+                win.setConstraint(true, { top: 20, left: 20, bottom: 30, right: 20 });
+                win.maximize();
+                win.showCenter(true, 20, 20);
+              
+            }
+
+
+
+
+
+      infowindow = new google.maps.InfoWindow();
+
+      function geocodePosition(pos) {
+          m = typeof geocoder;
+            if (m == "undefined" ) return;
+        geocoder.geocode({      
+                'latLng': pos    },
+                function(responses) {      
+                    if (responses && responses.length > 0) {        
+                        updateMarkerAddress(responses[0].formatted_address);
+                    } else {        
+                        updateMarkerAddress('Cannot determine address at this location.');      
+                      }    
+                }); 
+       }    
+       
+       function updateMarkerStatus(str) {    
+                document.getElementById('markerStatus').innerHTML = str; 
+        }    
+        
+        function updateMarkerPosition(latLng) {    
+                document.Envoie.lat.value=latLng.lat() ;
+                document.Envoie.lon.value = latLng.lng();
+                
+                }
+           
+           function updateMarkerAddress(str) {               
+                 message =  str;
+                 document.getElementById('markerAdress').innerHTML = str; 
+
+            }
+
+
+        }
+
+
+ 
+
+
+
+      
+  /* Initialisation de la carte  */
+        function initialize() {
+            geocoder = new google.maps.Geocoder();
+            var latlng = new google.maps.LatLng(40.730885, -73.997383);
+            var myOptions = {
+                zoom: 8,
+                center: latlng,
+                mapTypeId: 'roadmap'
+            }
+            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+        }
+
+
+        /* Fonction de géocodage déclenchée en cliquant surle bouton "Geocoder"  */
+        function codeAddress() {
+            /* Récupération de la valeur de l'adresse saisie */
+            var address = document.getElementById("match").value;
+            /* Appel au service de geocodage avec l'adresse en paramètre */
+            geocoder.geocode({ 'address': address }, function (results, status) {
+                /* Si l'adresse a pu être géolocalisée */
+                if (status == google.maps.GeocoderStatus.OK) {
+                    /* Récupération de sa latitude et de sa longitude */
+                    document.Envoie.lat.value = results[0].geometry.location.lat();
+                    document.Envoie.lon.value = results[0].geometry.location.lng();
+                    map.setCenter(results[0].geometry.location);
+                    /* Affichage du marker */
+                    var marker = new google.maps.Marker({
+                        map: map,
+                        position: results[0].geometry.location
+                    });
+                    /* Permet de supprimer le marker précédemment affiché */
+                    markers.push(marker);
+                    if (markers.length > 1)
+                        markers[(i - 1)].setMap(null);
+                    i++;
+                } else {
+                    alert("Le geocodage n\'a pu etre effectue pour la raison suivante: " + status);
+                }
+            });
+        }
+
+
+
+  /* Fonction de géocodage inversé  */
+  function codeLatLng() {
+   var lat = parseFloat(document.Envoie.lat.value);
+   var lng = parseFloat(document.Envoie.lon.value);
+   var latlng = new google.maps.LatLng(lat, lng);
+
+   geocoder.geocode({ 'latLng': latlng },
+              function(results, status) {
+                    /* Si le géocodage inversé a réussi */
+                    if (status == google.maps.GeocoderStatus.OK) {
+                     if (results[1]) {
+                        map.setZoom(11);
+                        marker = new google.maps.Marker({
+                        position: latlng,
+                        map: map
+                       });
+      /* Affichage de l'infowindow sur le marker avec l'adresse récupérée */
+      infowindow.setContent(results[1].formatted_address);
+      infowindow.open(map, marker);
+     }
+    } else {
+     alert("Le geocodage a echoue pour la raion suivante : " + status);
+    }
+   });
+  }
+ 
Index: /extensions/edit_gmaps/language/fr_FR/lang.php
===================================================================
--- /extensions/edit_gmaps/language/fr_FR/lang.php	(revision 8455)
+++ /extensions/edit_gmaps/language/fr_FR/lang.php	(revision 8456)
@@ -1,4 +1,7 @@
 <?php
 global $lang;
+$lang['search_title']='Rechercher un lieu...';
+$lang['map']='Carte';
+
 $lang['selection']="Sélection";
 $lang['reset'] ="Raz"  ;
@@ -12,4 +15,5 @@
 
 $lang['Map']='Carte';
+
 
 $lang['displays %s on a map']='afficher %s sur la carte';
@@ -25,4 +29,6 @@
 $lang['show all pictures around this location']='Présente toutes les images à proximité de ces coordonnées';
 $lang['Search a location...']='Rechercher un lieu...';
+$lang['search_title']='Rechercher un lieu...';
+
 
 $lang['Loading']='Chargement';
Index: /extensions/edit_gmaps/template/cl_conflit.tpl
===================================================================
--- /extensions/edit_gmaps/template/cl_conflit.tpl	(revision 8455)
+++ /extensions/edit_gmaps/template/cl_conflit.tpl	(revision 8456)
@@ -7,4 +7,6 @@
   jQuery.noConflict();
 </script>{/literal}
+   {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
+
 {known_script id="jquery.ui" src=$ROOT_URL|@cat:$path_j@cat"ui/ui.core.packed.js"}
 {known_script id="gally" src=$PLUGIN_ROOT_URL|@cat:"/template/script.js"}
