Index: /extensions/rv_gmaps/trunk/changelog.txt
===================================================================
--- /extensions/rv_gmaps/trunk/changelog.txt	(revision 18577)
+++ /extensions/rv_gmaps/trunk/changelog.txt	(revision 18578)
@@ -1,2 +1,8 @@
+2.4.e
+- removed earth icon from index pages
+- map icon text localized (for themes without icons)
+- minor javascript changes for maps api v3.9
+- code optimization
+
 2.4.d
 - edit position in batch manager unit
Index: /extensions/rv_gmaps/trunk/include/cluster_maker.php
===================================================================
--- /extensions/rv_gmaps/trunk/include/cluster_maker.php	(revision 18577)
+++ /extensions/rv_gmaps/trunk/include/cluster_maker.php	(revision 18578)
@@ -30,4 +30,13 @@
 	function make_clusters($images, $maxLatPrecision, $maxLonPrecision, $maxNbMarkers)
 	{
+		$this->bounds = array();
+		foreach($images as &$img)
+		{
+			$img['lat'] = floatval($img['lat']);
+			$img['lon'] = floatval($img['lon']);
+			$this->bounds = bounds_add($this->bounds, $img['lat'], $img['lon'] );
+		}
+		unset($img);
+
 		$this->_image_map = $images;
 		$this->_image_ranks = array();
@@ -37,8 +46,4 @@
 		$total_iterations = 0;
 		$total_generations = 0;
-
-		$this->bounds = array();
-		foreach($images as $img)
-			$this->bounds = bounds_add($this->bounds, $img['lat'], $img['lon'] );
 
 		$pending_split = array( new Cluster($this->bounds, array_keys($this->_image_map) ) );
@@ -68,5 +73,5 @@
 				}
 				else
-					array_push( $result, $current );
+					$result[] = $current;
 			}
 			$pending_split = $next_level_to_split;
@@ -93,5 +98,5 @@
 				$rlat = abs($ci['lat']-$cj['lat']) / $maxLatPrecision;
 				$rlon = abs($ci['lon']-$cj['lon']) / $maxLonPrecision;
-				if ( $rlat<1 && $rlon<1 
+				if ( $rlat<1 && $rlon<1
 						&& $rlat+$rlon<1.1)
 				{
@@ -183,5 +188,5 @@
 				$clusters[$idx] = new Cluster();
 			}
-			array_push( $clusters[$idx]->items, $id );
+			$clusters[$idx]->items[] = $id;
 			$clusters[$idx]->bounds = bounds_add( $clusters[$idx]->bounds , $lat, $lon );
 		}
Index: /extensions/rv_gmaps/trunk/main.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/main.inc.php	(revision 18577)
+++ /extensions/rv_gmaps/trunk/main.inc.php	(revision 18578)
@@ -1,5 +1,5 @@
 <?php /*
 Plugin Name: RV Maps&Earth
-Version: 2.4.d
+Version: 2.4.e
 Description: Extend your gallery with Google Maps and Google Earth ...
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122
@@ -7,5 +7,5 @@
 Author URI: http://www.modusoptimus.com/
 */
-define( 'RVM_PLUGIN_VERSION', '2.4.d');
+define( 'RVM_PLUGIN_VERSION', '2.4.e');
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
@@ -81,19 +81,8 @@
 
 	$map_url = rvm_duplicate_map_index_url( array(), array('start') );
-	if ( !empty($map_url) )
-	{
-		$link_title = sprintf( l10n('displays %s on a map'), strip_tags($page['title']) );
-		$template->concat( 'PLUGIN_INDEX_ACTIONS' , "\n<li>".sprintf(RVM_ACTION_MODEL,
-			$map_url, $link_title, '', 'map', 'map'
-			).'</li>');
-	}
-
-	{
-		$kml_url = rvm_duplicate_kml_index_url( array(), array('start') );
-		$link_title = sprintf( l10n('opens %s in Google Earth'), strip_tags($page['title']) );
-		$template->concat( 'PLUGIN_INDEX_ACTIONS' , "\n<li>".sprintf(RVM_ACTION_MODEL,
-			$kml_url, $link_title, ' type="application/vnd.google-earth.kml+xml"', 'globe', 'earth'
-			).'</li>');
-	}
+	$link_title = sprintf( l10n('displays %s on a map'), strip_tags($page['title']) );
+	$template->concat( 'PLUGIN_INDEX_ACTIONS' , "\n<li>".sprintf(RVM_ACTION_MODEL,
+		$map_url, $link_title, '', 'map', l10n('Map')
+		).'</li>');
 }
 
@@ -114,5 +103,5 @@
 			$link_title = sprintf( l10n('displays %s on a map'), strip_tags($pictures['current']['name']) );
 			$template->concat( 'PLUGIN_PICTURE_ACTIONS' , sprintf(RVM_ACTION_MODEL,
-					$map_url, $link_title, ' target="_top"', 'map', 'map'
+					$map_url, $link_title, ' target="_top"', 'map', l10n('Map')
 				));
 		}
Index: /extensions/rv_gmaps/trunk/map_data.php
===================================================================
--- /extensions/rv_gmaps/trunk/map_data.php	(revision 18577)
+++ /extensions/rv_gmaps/trunk/map_data.php	(revision 18578)
@@ -31,5 +31,5 @@
 $where_sql = rvm_bounds_to_sql( $page['box'] );
 
-$img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.path,i.lat,i.lon';
+$img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.lat,i.lon';
 
 $was_flat = @$page['flat'];
@@ -79,58 +79,54 @@
 $out='';
 function rvo($s) {
-  global $out; $out.=$s;
+  //global $out; $out.=$s;
+	echo $s;
 }
 
 function rvf() {
-  global $out; echo $out; $out='';
-  ob_flush();
+  //global $out; echo $out; $out=''; ob_flush();
 }
 
 $start_output = get_moment();
 
-rvo( '{' );
 
-rvo( "\ntitle:".jsgm_str( strip_tags(trigger_event('render_element_description', $page['title']) ) ) );
-rvo( ",\n" );
+rvo( "{\ntitle:".jsgm_str( strip_tags(trigger_event('render_element_description', $page['title']) ) ) );
 
-rvo( "page_url:".jsgm_str( duplicate_index_url( array('start'=>0) ) ) );
-rvo( ",\n" );
+rvo( ",\npage_url:".jsgm_str( duplicate_index_url( array('start'=>0) ) ) );
 
-rvo( "blowup_url:".jsgm_str( rvm_duplicate_blowup_url( array('start'=>0) ) ) );
-rvo( ",\n" );
+rvo( ",\nblowup_url:".jsgm_str( rvm_duplicate_blowup_url( array('start'=>0) ) ) );
 
-rvo( "kml_url:".jsgm_str( rvm_duplicate_kml_index_url( array('start'=>0, 'flat'=>1) ) ) );
-rvo( ",\n" );
+rvo( ",\nkml_url:".jsgm_str( rvm_duplicate_kml_index_url( array('start'=>0, 'flat'=>1) ) ) );
 
-rvo( "nb_items:".count($page['items']) );
-rvo( ",\n" );
+rvo( ",\nnb_items:".count($page['items']) );
 
-rvo( "bounds:" );
+rvo( ",\nbounds:" );
 if ( isset($cm) )
   rvo( jsgm_bounds( $cm->bounds ) );
 else
   rvo( "null" );
-rvo( ",\n" );
 
+rvo( ",\n\nnb_clusters:".count($clusters) );
 
-rvo( "\nnb_clusters:".count($clusters) );
-rvo( "," );
-
-rvo( "\nimage_clusters:[\n" );
+rvo( ",\nimage_clusters:[\n" );
 $i=0;
 $thumb_params = ImageStdParams::get_by_type(IMG_THUMB);
+$page_url_model = duplicate_picture_url(
+		array(
+			'image_id' => 123456789,
+			'image_file' => 'dummy_file.txt',
+			'flat' => 1,
+		),
+		array('start')
+	);
+
 foreach( $clusters as $c )
 {
   if ($i) rvo( ",\n\n" );
-  rvo( "{" );
-  rvo( 'position:'. jsgm_position( bounds_center($c->bounds) ) );
-  rvo( ",\n" );
-  rvo( 'bounds:'. jsgm_bounds( $c->bounds ) );
-  rvo( ",\n" );
-  rvo( 'nb_items:'.count($c->items) );
+  rvo( '{position:'. jsgm_position( bounds_center($c->bounds) ) );
+  rvo( ",\nbounds:". jsgm_bounds( $c->bounds ) );
+  rvo( ",\nnb_items:".count($c->items) );
   rvo( ",\n" );
 
   rvo( 'blowup_url:"'.rvm_duplicate_blowup_url(array('box'=>$c->bounds), array('start') ). '"' );
-  rvo( ",\n" );
 
   $max_per_cluster = rvm_get_config_var('nb_images_per_marker',20);
@@ -139,20 +135,13 @@
     $c->items = array_slice($c->items, 0, $max_per_cluster);
   }
-  rvo( 'items:[' );
+  rvo( ",\nitems:[" );
   for ($j=0; $j<count($c->items); $j++)
   {
     $img = $page['items'] [ $c->items[$j] ];
-    $img['file'] = basename( $img['path'] );
 
-    $params = array(
-        'image_id' => $img['id'],
-        'image_file' => $img['file'],
-        'flat' => 1,
-      );
-    $page_url = duplicate_picture_url($params, array('start') );
+		$page_url = str_replace(array('123456789','dummy_file'), array($img['id'], get_filename_wo_extension($img['file'])), $page_url_model);
 
     if ($j) rvo( "," );
-    rvo( "{" );
-    rvo( "tn:".jsgm_str( DerivativeImage::url( $thumb_params,$img ) ) );
+    rvo( "{tn:".jsgm_str( DerivativeImage::url( $thumb_params,$img ) ) );
     rvo( ",name:".jsgm_str( render_element_name($img) ) );
     rvo( ",comment:".jsgm_str( render_element_description($img) ) );
@@ -160,7 +149,5 @@
     rvo( "}" );
   }
-  rvo( ']' );
-  rvo( "\n" );
-  rvo( "}" );
+  rvo( "]\n}" );
   rvf();
   $i++;
Index: /extensions/rv_gmaps/trunk/mapl.php
===================================================================
--- /extensions/rv_gmaps/trunk/mapl.php	(revision 18577)
+++ /extensions/rv_gmaps/trunk/mapl.php	(revision 18578)
@@ -33,4 +33,5 @@
   }
 }
+$page['meta_robots']['noindex']=1;
 
 // deleting first "/" if displayed
Index: /extensions/rv_gmaps/trunk/template/data_loader.js
===================================================================
--- /extensions/rv_gmaps/trunk/template/data_loader.js	(revision 18577)
+++ /extensions/rv_gmaps/trunk/template/data_loader.js	(revision 18578)
@@ -78,5 +78,5 @@
 	
 	//BEGIN BUG in maps api as of v3.7 - when map wraps horizontally more than 360 deg - the getBounds is wrong
-	var isOver = false;
+	/*var isOver = false;
 	if (bounds.getSouthWest().lng() < bounds.getNorthEast().lng())
 	{
@@ -102,5 +102,5 @@
 	
 	if (isOver)
-		bounds = new google.maps.LatLngBounds( new google.maps.LatLng(this._map.getBounds().getSouthWest().lat(),-180), new google.maps.LatLng(this._map.getBounds().getNorthEast().lat(), 179.99) );
+		bounds = new google.maps.LatLngBounds( new google.maps.LatLng(this._map.getBounds().getSouthWest().lat(),-180), new google.maps.LatLng(this._map.getBounds().getNorthEast().lat(), 179.99) );*/
 	//END bug
 	
