Index: /extensions/rv_gmaps/trunk/changelog.txt
===================================================================
--- /extensions/rv_gmaps/trunk/changelog.txt	(revision 5017)
+++ /extensions/rv_gmaps/trunk/changelog.txt	(revision 5018)
@@ -1,2 +1,7 @@
+2.0.d
+  - hungarian translation thanks to external contributors
+  - the map uses now the 3D Large map control as on google maps website
+  - dirty fix for bug inroduced in api version 2.185 (and up to 2.193 as of now online) - http://code.google.com/p/gmaps-api-issues/issues/detail?id=2009&q=apitype%3AJavascript&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars
+
 2.0.c
   - google maps api is loaded using the same language as piwigo
Index: /extensions/rv_gmaps/trunk/main.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/main.inc.php	(revision 5017)
+++ /extensions/rv_gmaps/trunk/main.inc.php	(revision 5018)
@@ -1,5 +1,5 @@
 <?php /*
 Plugin Name: RV Maps&Earth
-Version: 2.0.c
+Version: 2.0.d
 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.0.c');
+define( 'RVM_PLUGIN_VERSION', '2.0.d');
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
Index: /extensions/rv_gmaps/trunk/template/data_loader.js
===================================================================
--- /extensions/rv_gmaps/trunk/template/data_loader.js	(revision 5017)
+++ /extensions/rv_gmaps/trunk/template/data_loader.js	(revision 5018)
@@ -1,14 +1,14 @@
 function PwgDataLoader( map, opts )
 {
-  this._map = map;
-  this.options = Object.extend(
-    {
-      reload_data_timeout: 1800,
-      rectangle_of_confusion: G_DEFAULT_ICON.iconSize
-    }
-    , opts || {} );
-  this.options.rectangle_of_confusion = new GSize( this.options.rectangle_of_confusion.width, this.options.rectangle_of_confusion.height );
-  if (this.options.rectangle_of_confusion.width<16) this.options.rectangle_of_confusion.width=16;
-  if (this.options.rectangle_of_confusion.height<16) this.options.rectangle_of_confusion.height=16;
+	this._map = map;
+	this.options = Object.extend(
+		{
+			reload_data_timeout: 1800,
+			rectangle_of_confusion: G_DEFAULT_ICON.iconSize
+		}
+		, opts || {} );
+	this.options.rectangle_of_confusion = new GSize( this.options.rectangle_of_confusion.width, this.options.rectangle_of_confusion.height );
+	if (this.options.rectangle_of_confusion.width<16) this.options.rectangle_of_confusion.width=16;
+	if (this.options.rectangle_of_confusion.height<16) this.options.rectangle_of_confusion.height=16;
 }
 
@@ -17,7 +17,7 @@
 getLatLonDigits = function(d, factor, exp)
 {
-  if (d<0) return getLatLonDigits(-d,factor,exp);
-  var digits = Math.ceil( exp - Math.log(d*factor)/Math.LN10 );
-  return digits<0 ? 0 : (digits>6 ? 6 : digits);
+	if (d<0) return getLatLonDigits(-d,factor,exp);
+	var digits = Math.ceil( exp - Math.log(d*factor)/Math.LN10 );
+	return digits<0 ? 0 : (digits>6 ? 6 : digits);
 }
 
@@ -36,33 +36,31 @@
 start: function(urlMapData)
 {
-  this._urlMapData = urlMapData;
-  GEvent.bind( this._map, "movestart", this, this.clearTimerReloadData );
-  GEvent.bind( this._map, "moveend", this, this._onMapMoveEnd );
-  this._loadData();
+	this._urlMapData = urlMapData;
+	GEvent.bind( this._map, "movestart", this, this.clearTimerReloadData );
+	GEvent.bind( this._map, "moveend", this, this._onMapMoveEnd );
+	this._loadData();
 },
 
 terminate: function()
 {
-  this.clearTimerReloadData();
-  this._map = null;
+	this.clearTimerReloadData();
+	this._map = null;
 },
 
 clearTimerReloadData : function()
 {
-  if (this._timerReloadData)
-  {
-    clearTimeout( this._timerReloadData );
-    this._timerReloadData = null;
-    return true;
-  }
-  return false;
+	if (this._timerReloadData)
+	{
+		clearTimeout( this._timerReloadData );
+		this._timerReloadData = null;
+		return true;
+	}
+	return false;
 },
 
 _onMapMoveEnd: function()
 {
-  this.clearTimerReloadData();
-  this._timerReloadData = setTimeout(
-    this._onTimeoutLoadData.bind(this),
-    this.options.reload_data_timeout);
+	this.clearTimerReloadData();
+	this._timerReloadData = setTimeout(  this._onTimeoutLoadData.bind(this), this.options.reload_data_timeout );
 },
 
@@ -70,119 +68,128 @@
 _onTimeoutLoadData: function ()
 {
-  if (this._dataLoading) return; // still in progress
-  this.clearTimerReloadData();
-  this._loadData();
+	if (this._dataLoading) return; // still in progress
+	this.clearTimerReloadData();
+	this._loadData();
 },
 
 _loadData: function()
 {
-  var bounds = this._map.getBounds();
+	var bounds = this._map.getBounds();
 
-  var latRange = bounds.toSpan().lat();
-  var latPrec = latRange * this.options.rectangle_of_confusion.height / this._map.getSize().height;
+	// BEGIN BUG in maps api 2.185 up to "today" 2.193 - when map wraps horizontally more than 360 deg - the getBounds is wrong
+	if ( this._map.getZoom() <= 2 )
+	{
+		bounds = new GLatLngBounds(
+				new GLatLng( bounds.getSouthWest().lat(),  -180 ),
+				new GLatLng( bounds.getNorthEast().lat(),  180 )
+			);
+	}
+	// END BUG
+	var latRange = bounds.toSpan().lat();
+	var latPrec = latRange * this.options.rectangle_of_confusion.height / this._map.getSize().height;
 
-  var lonRange = bounds.toSpan().lng();
-  var lonPrec = ( lonRange>=0 ? lonRange : 360-lonRange )* this.options.rectangle_of_confusion.width / this._map.getSize().width;
+	var lonRange = bounds.toSpan().lng();
+	var lonPrec = ( lonRange>=0 ? lonRange : 360-lonRange )* this.options.rectangle_of_confusion.width / this._map.getSize().width;
 
-  if ( this._previousLoadDataReq.box!=null )
-  { // not the first time
-    if ( this._previousLoadDataReq.box.containsBounds( bounds ) )
-    {
-      if ( this._previousLoadDataReq.resultBounds == null )
-        return; // no images here
-      if ( this._map.getZoom() <= this._previousLoadDataReq.zoom )
-        return;
-      else
-      {
-        if (
-          this._map.getZoom() == this._previousLoadDataReq.zoom + 1
-          && this._map.getZoom() < this._map.getBoundsZoomLevel(this._previousLoadDataReq.resultBounds)
-          )
-        {
-          if (document.is_debug) GLog.write('no load: zoom crt: '+this._map.getZoom()+'; prev: '+this._previousLoadDataReq.zoom+'; target: '+this._map.getBoundsZoomLevel(this._previousLoadDataReq.resultBounds));
-          return;
-        }
-      }
-    }
-    else
-    {
-    }
-  }
+	if ( this._previousLoadDataReq.box!=null )
+	{ // not the first time
+		if ( this._previousLoadDataReq.box.containsBounds( bounds ) )
+		{
+			if ( this._previousLoadDataReq.resultBounds == null )
+				return; // no images here
+			if ( this._map.getZoom() <= this._previousLoadDataReq.zoom )
+				return;
+			else
+			{
+				if (
+					this._map.getZoom() == this._previousLoadDataReq.zoom + 1
+					&& this._map.getZoom() < this._map.getBoundsZoomLevel(this._previousLoadDataReq.resultBounds)
+					)
+				{
+					if (document.is_debug) GLog.write('no load: zoom crt: '+this._map.getZoom()+'; prev: '+this._previousLoadDataReq.zoom+'; target: '+this._map.getBoundsZoomLevel(this._previousLoadDataReq.resultBounds));
+					return;
+				}
+			}
+		}
+		else
+		{
+		}
+	}
 
-  var nd=0, sd=0, ed=0, wd=0;
-  if ( !bounds.isFullLat() )
-  {
-    nd = latRange*12/100;
-    sd = latRange*4/100;
-  }
-  if ( !bounds.isFullLng() )
-  {
-    ed = lonRange*9/100;
-    wd = lonRange*7/100;
-  }
-  var digits = Math.max( getLatLonDigits(latRange,4,2), getLatLonDigits(lonRange,4,2) );
-  var box = new GLatLngBounds(
-      new GLatLng( Math.roundN(bounds.getSouthWest().lat()-sd,digits), Math.roundN( bounds.getSouthWest().lng()-wd,digits ) ),
-      new GLatLng( Math.roundN(bounds.getNorthEast().lat()+nd,digits), Math.roundN(bounds.getNorthEast().lng()+ed,digits) )
-    );
-  
-  var url = this._urlMapData;
-  url += "&box=" + box.getSouthWest().toUrlValue(5) + "," + box.getNorthEast().toUrlValue(5);
-  url += "&lap=" +  Math.roundN( latPrec, getLatLonDigits(latPrec,1,1) ).toString();
-  url += "&lop=" +  Math.roundN( lonPrec, getLatLonDigits(lonPrec,1,1) ).toString();
-  
-  if (document.is_debug) {
-    GLog.write( "bounds: " + bounds.getSouthWest().toUrlValue() + " " + bounds.getNorthEast().toUrlValue() +"; zoom: "+this._map.getZoom() +"; size: "+this._map.getSize().toString() +"; c: "+this._map.getCenter().toUrlValue() );
-    GLog.writeUrl( url );
-  }
-  
-  this._previousLoadDataReq.box = box;
-  this._previousLoadDataReq.zoom = this._map.getZoom();
-  this._previousLoadDataReq.resultBounds = null;
-  this._dataLoading = true;
+	var nd=0, sd=0, ed=0, wd=0;
+	if ( !bounds.isFullLat() )
+	{
+		nd = latRange*12/100;
+		sd = latRange*4/100;
+	}
+	if ( !bounds.isFullLng() )
+	{
+		ed = lonRange*9/100;
+		wd = lonRange*7/100;
+	}
+	var digits = Math.max( getLatLonDigits(latRange,4,2), getLatLonDigits(lonRange,4,2) );
+	var box = new GLatLngBounds(
+			new GLatLng( Math.roundN(bounds.getSouthWest().lat()-sd,digits), Math.roundN( bounds.getSouthWest().lng()-wd,digits ) ),
+			new GLatLng( Math.roundN(bounds.getNorthEast().lat()+nd,digits), Math.roundN( bounds.getNorthEast().lng()+ed,digits) )
+		);
 
-  try {
-    GEvent.trigger( this, "dataloading" );
-    GDownloadUrl(url, this._onDataReceived.bind(this) );
-  }
-  catch (e) {
-    this._dataLoading = false;
-    this._previousLoadDataReq.box=null;
-    GEvent.trigger( this, "dataloadfailed", 600, e );
-  }
+	var url = this._urlMapData;
+	url += "&box=" + box.getSouthWest().toUrlValue(5) + "," + box.getNorthEast().toUrlValue(5);
+	url += "&lap=" +  Math.roundN( latPrec, getLatLonDigits(latPrec,1,1) ).toString();
+	url += "&lop=" +  Math.roundN( lonPrec, getLatLonDigits(lonPrec,1,1) ).toString();
+
+	if (document.is_debug) {
+		GLog.write( "bounds: " + this._map.getBounds().getSouthWest().toUrlValue() + " " + this._map.getBounds().getNorthEast().toUrlValue() +"; zoom: "+this._map.getZoom() +"; size: "+this._map.getSize().toString() +"; c: "+this._map.getCenter().toUrlValue() );
+		GLog.writeUrl( url );
+	}
+
+	this._previousLoadDataReq.box = box;
+	this._previousLoadDataReq.zoom = this._map.getZoom();
+	this._previousLoadDataReq.resultBounds = null;
+	this._dataLoading = true;
+
+	try {
+		GEvent.trigger( this, "dataloading" );
+		GDownloadUrl(url, this._onDataReceived.bind(this) );
+	}
+	catch (e) {
+		this._dataLoading = false;
+		this._previousLoadDataReq.box=null;
+		GEvent.trigger( this, "dataloadfailed", 600, e );
+	}
 },
 
 _onDataReceived: function(data, responseCode)
 {
-  var resp;
-  try
-  {
-    if (responseCode!=200)
-    {
-      this._previousLoadDataReq.box=null;
-      GEvent.trigger( this, "dataloadfailed", responseCode, null );
-    }
-    else
-    try
-    {
-  		eval('resp = ' + data);
-  		if (resp.nb_items == undefined)
-        throw new Error( "DATA DECODING ERROR" );
+	var resp;
+	try
+	{
+		if (responseCode!=200)
+		{
+			this._previousLoadDataReq.box=null;
+			GEvent.trigger( this, "dataloadfailed", responseCode, null );
+		}
+		else
+		try
+		{
+			eval('resp = ' + data);
+			if (resp.nb_items == undefined)
+				throw new Error( "DATA DECODING ERROR" );
 
-  		this._previousLoadDataReq.resultBounds = resp.bounds;
-  		if (document.is_debug && resp.debug) GLog.write( resp.debug );
-  		GEvent.trigger( this, "dataloaded", resp );
-  	}
-  	catch (e)	{
-      this._previousLoadDataReq.box=null;
-  	  GEvent.trigger( this, "dataloadfailed", responseCode, e );
-  		var s = e.message;
-  		s += '\n' + data.substr(0,1000);
-  		alert( s );
-  	}
-  }
-  finally {
-    this._dataLoading = false;
-  }
+			this._previousLoadDataReq.resultBounds = resp.bounds;
+			if (document.is_debug && resp.debug) GLog.write( resp.debug );
+			GEvent.trigger( this, "dataloaded", resp );
+		}
+		catch (e)	{
+			this._previousLoadDataReq.box=null;
+			GEvent.trigger( this, "dataloadfailed", responseCode, e );
+			var s = e.message;
+			s += '\n' + data.substr(0,1000);
+			alert( s );
+		}
+	}
+	finally {
+		this._dataLoading = false;
+	}
 }
 
Index: /extensions/rv_gmaps/trunk/template/map.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/template/map.tpl	(revision 5017)
+++ /extensions/rv_gmaps/trunk/template/map.tpl	(revision 5018)
@@ -35,6 +35,6 @@
 document.is_debug = false;
 if ( document.location.search.match(/[\?&]debug/) ) {
-  document.is_debug = true;
-  document._window = window;
+	document.is_debug = true;
+	document._window = window;
 }
   
@@ -48,5 +48,5 @@
 
 	map.addMapType( G_PHYSICAL_MAP );
-	map.addControl(new GLargeMapControl());
+	map.addControl(new GLargeMapControl3D());
 	map.addControl(new GHierarchicalMapTypeControl());
 	map.addControl(new GScaleControl());
@@ -57,22 +57,22 @@
 {/literal}
 		{if isset($initial_bounds)}
-    var bounds = new GLatLngBounds( new GLatLng({$initial_bounds.s},{$initial_bounds.w}), new GLatLng({$initial_bounds.n},{$initial_bounds.e}) );
-    map.setCenter( bounds.getCenter(), map.getBoundsZoomLevel( bounds ) );
+		var bounds = new GLatLngBounds( new GLatLng({$initial_bounds.s},{$initial_bounds.w}), new GLatLng({$initial_bounds.n},{$initial_bounds.e}) );
+		map.setCenter( bounds.getCenter(), map.getBoundsZoomLevel( bounds ) );
 		{/if}
 {literal}
 		if ( !map.isLoaded() )
 			map.setCenter( new GLatLng(0,0), 2 );
-  }
-
-  try {
+	}
+
+	try {
 		// the overview must be added after setting map center
 		var ovcontrol = new GOverviewMapControl(new GSize(165,165));
 		map.addControl(ovcontrol);
-  }
-  catch(e){ alert( e.message ); }
-  
+	}
+	catch(e){ alert( e.message ); }
+
 	map.enableScrollWheelZoom();
 	map.enableDoubleClickZoom();
-  
+
 	var pwgMarkerIcon = (function(){ {/literal}{$MAP_MARKER_ICON_JS}{literal} }).call(null);
 
@@ -100,5 +100,5 @@
 		GEvent.addListener(map, "infowindowopen", function() { GLog.write("infowindowopen");} );
 		GEvent.addListener(map, "infowindowclose", function() { GLog.write("infowindowclose");} );
-  }
+	}
 }
 
@@ -120,25 +120,25 @@
 	geocoder.getLocations(q, function(resp)
 	  {
-	    if ( resp && resp.Status )
-	    {
-	      document._geoResponse = resp;
-	      if (resp.Status.code==200)
-	      {
-	        var zoom = 2;
-	        switch (resp.Placemark[0].AddressDetails.Accuracy)
-	        {
-	          case 1: zoom=5; break; //country
-	          case 2: zoom=7; break; //region
-	          case 3: zoom=8; break; //county
-	          case 4: zoom=12; break; //town
-	          case 5: zoom=13; break; //post code
-	          case 6: zoom=14; break; //street
-	          case 7: case 8: zoom=16; break; //intersection/exact
-	        }
-	        map.setCenter( new GLatLng( resp.Placemark[0].Point.coordinates[1], resp.Placemark[0].Point.coordinates[0] ), zoom);
-	      }
-	      else
-	        alert("This address has not been found\nCode:"+resp.Status.code);
-	    }
+		if ( resp && resp.Status )
+		{
+		  document._geoResponse = resp;
+		  if (resp.Status.code==200)
+		  {
+			var zoom = 2;
+			switch (resp.Placemark[0].AddressDetails.Accuracy)
+			{
+			  case 1: zoom=5; break; //country
+			  case 2: zoom=7; break; //region
+			  case 3: zoom=8; break; //county
+			  case 4: zoom=12; break; //town
+			  case 5: zoom=13; break; //post code
+			  case 6: zoom=14; break; //street
+			  case 7: case 8: zoom=16; break; //intersection/exact
+			}
+			map.setCenter( new GLatLng( resp.Placemark[0].Point.coordinates[1], resp.Placemark[0].Point.coordinates[0] ), zoom);
+		  }
+		  else
+			alert("This address has not been found\nCode:"+resp.Status.code);
+		}
 	  });
 	return false;
