Index: /extensions/rv_gmaps/trunk/admin/admin_config.php
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_config.php	(revision 23082)
+++ /extensions/rv_gmaps/trunk/admin/admin_config.php	(revision 23083)
@@ -44,4 +44,6 @@
 
   $gm_config['marker_icon'] = $_POST['marker_icon'];
+	$gm_config['map_type'] = $_POST['map_type'];
+
   mkgetdir( dirname(rvm_get_config_file_name()) );
   $fp = fopen( rvm_get_config_file_name(), 'w');
@@ -60,4 +62,5 @@
       'NB_MARKERS' => rvm_get_config_var('nb_markers',40),
       'NB_IMAGES_PER_MARKER' => rvm_get_config_var('nb_images_per_marker',20),
+			'MAP_TYPE' => rvm_get_config_var('map_type','ROADMAP'),
     )
   );
@@ -84,6 +87,13 @@
     );
 }
+
 $template->assign('selected_marker_icon', rvm_get_config_var('marker_icon', '') );
 
-
+$map_types = array(
+	"ROADMAP" => "Roadmap (Default)",
+	"SATELLITE" => "Satellite",
+	"HYBRID" => "Hybrid",
+	"TERRAIN" => "Terrain",
+);
+$template->assign('map_types', $map_types);
 ?>
Index: /extensions/rv_gmaps/trunk/admin/admin_config.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/admin/admin_config.tpl	(revision 23082)
+++ /extensions/rv_gmaps/trunk/admin/admin_config.tpl	(revision 23083)
@@ -55,4 +55,13 @@
   </li>
 
+  <li>
+  <label>
+    Default map type:
+    <select name="map_type">
+      {html_options options=$map_types selected=$MAP_TYPE}
+    </select>
+  </label>
+  </li>
+
   </ul>
 
Index: /extensions/rv_gmaps/trunk/changelog.txt
===================================================================
--- /extensions/rv_gmaps/trunk/changelog.txt	(revision 23082)
+++ /extensions/rv_gmaps/trunk/changelog.txt	(revision 23083)
@@ -1,2 +1,8 @@
+2.5.c
+- admin can choose default map type (roadmap, satellite, ...)
+- auto center and zoom when viewing map for the entire gallery
+- fix kml namespace
+- attempt to fix uage with https on the photo page (need test)
+
 2.5.b
 - more forgiving about some wrong exif gps formatting
Index: /extensions/rv_gmaps/trunk/include/picture_map.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/include/picture_map.inc.php	(revision 23082)
+++ /extensions/rv_gmaps/trunk/include/picture_map.inc.php	(revision 23083)
@@ -34,4 +34,5 @@
   $template->assign(
     array(
+			'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') ),
Index: /extensions/rv_gmaps/trunk/main.inc.php
===================================================================
--- /extensions/rv_gmaps/trunk/main.inc.php	(revision 23082)
+++ /extensions/rv_gmaps/trunk/main.inc.php	(revision 23083)
@@ -1,5 +1,5 @@
 <?php /*
 Plugin Name: RV Maps&Earth
-Version: 2.5.b
+Version: 2.5.c
 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.5.b');
+define( 'RVM_PLUGIN_VERSION', '2.5.c');
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
@@ -108,6 +108,5 @@
 		}
 	}
-	else
-		if ( isset($_GET['map']) )
+	elseif ( isset($_GET['map']) )
 			redirect( duplicate_picture_url() );
 	return $pictures;
Index: /extensions/rv_gmaps/trunk/map.php
===================================================================
--- /extensions/rv_gmaps/trunk/map.php	(revision 23082)
+++ /extensions/rv_gmaps/trunk/map.php	(revision 23083)
@@ -48,5 +48,5 @@
   check_restrictions($page['category']['id']);
 
-if ( !isset($_GET['ll']) and ($page['section']!='categories' or isset($page['category']) ) )
+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';
@@ -69,5 +69,4 @@
     'CONTENT_ENCODING' => get_pwg_charset(),
     'RVM_PLUGIN_VERSION' => RVM_PLUGIN_VERSION,
-    'GMAPS_API_KEY' => $conf['gmaps_api_key'],
     'PLUGIN_ROOT_URL' => get_absolute_root_url().'plugins/'.$rvm_dir,
 		'PLUGIN_LOCATION' => 'plugins/'.$rvm_dir,
@@ -76,4 +75,5 @@
     'U_HOME' => make_index_url(),
     'U_HOME_MAP' => rvm_make_map_index_url(),
+		'MAP_TYPE' => rvm_get_config_var('map_type', 'ROADMAP'),
   )
   );
Index: /extensions/rv_gmaps/trunk/template/earth_kml.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/template/earth_kml.tpl	(revision 23082)
+++ /extensions/rv_gmaps/trunk/template/earth_kml.tpl	(revision 23083)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="{$CONTENT_ENCODING}"?>
-<kml xmlns="http://earth.google.com/kml/2.2">
+<kml xmlns="http://www.opengis.net/kml/2.2">
 <Document>
 	<Style id="img_normal">
@@ -27,10 +27,10 @@
 {if not empty($region)}
 <Region> 
-  <LatLonAltBox> 
-    <north>{$region.n}</north>
-    <south>{$region.s}</south>
-    <east>{$region.e}</east>
-    <west>{$region.w}</west>
-  </LatLonAltBox> 
+	<LatLonAltBox> 
+		<north>{$region.n}</north>
+		<south>{$region.s}</south>
+		<east>{$region.e}</east>
+		<west>{$region.w}</west>
+	</LatLonAltBox> 
 </Region> 
 {/if}
@@ -39,27 +39,27 @@
 {foreach from=$categories item=category}
 <NetworkLink>
-  <visibility>0</visibility>
-  <name><![CDATA[{$category.NAME}]]></name>
-  <description><![CDATA[{$category.COMMENT}
+	<visibility>0</visibility>
+	<name><![CDATA[{$category.NAME}]]></name>
+	<description><![CDATA[{$category.COMMENT}
 	{if not empty($category.TN_SRC)}
-    <br/><img src="{$category.TN_SRC}" />
+		<br/><img src="{$category.TN_SRC}" />
 	{/if}
 ]]></description>
-  <Link>
-    <href>{$category.U_KML}</href>
-  </Link>   
+	<Link>
+		<href>{$category.U_KML}</href>
+	</Link>   
 {if not empty($category.region)}
-  <Region>
-    <LatLonAltBox>
-      <north>{$category.region.n}</north>
-      <south>{$category.region.s}</south>
-      <east>{$category.region.e}</east>
-      <west>{$category.region.w}</west>
-    </LatLonAltBox>
-  </Region>
-  <TimeSpan>
-    <begin>{$category.region.min_date}</begin>
-    <end>{$category.region.max_date}</end>
-  </TimeSpan>
+	<Region>
+		<LatLonAltBox>
+			<north>{$category.region.n}</north>
+			<south>{$category.region.s}</south>
+			<east>{$category.region.e}</east>
+			<west>{$category.region.w}</west>
+		</LatLonAltBox>
+	</Region>
+	<TimeSpan>
+		<begin>{$category.region.min_date}</begin>
+		<end>{$category.region.max_date}</end>
+	</TimeSpan>
 {/if}
 </NetworkLink>
Index: /extensions/rv_gmaps/trunk/template/map.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/template/map.tpl	(revision 23082)
+++ /extensions/rv_gmaps/trunk/template/map.tpl	(revision 23083)
@@ -48,5 +48,5 @@
 {
 	var mapOptions = {
-		mapTypeId: google.maps.MapTypeId.ROADMAP,
+		mapTypeId: google.maps.MapTypeId.{/literal}{$MAP_TYPE}{literal},
 		overviewMapControl: true,
 		overviewMapControlOptions: {opened: true}
@@ -56,11 +56,11 @@
 	{
 {/literal}
-		{if isset($initial_bounds)}
+{if isset($initial_bounds)}
 		mapOptions.iniBounds = new google.maps.LatLngBounds( new google.maps.LatLng({$initial_bounds.s},{$initial_bounds.w}), new google.maps.LatLng({$initial_bounds.n},{$initial_bounds.e}) );
 		mapOptions.center = mapOptions.iniBounds.getCenter();
-		{else}
-			mapOptions.center = new google.maps.LatLng(0,0);
-			mapOptions.zoom = 2;
-		{/if}
+{else}
+		mapOptions.center = new google.maps.LatLng(0,0);
+		mapOptions.zoom = 2;
+{/if}
 {literal}
 	}
@@ -176,6 +176,6 @@
   <div class="titlebar_links" >
     <span id="dataLoadStatus"></span>
-    <a id="aKml" href="" type="application/vnd.google-earth.kml+xml" class="gmnoprint"><img src="http://maps.google.com/mapfiles/ms/view_as_kml.png" width="16" height="16" alt="kml"> <span>KML</span></a>
-    <a id="aLinkToThisPage" href="" class="gmnoprint"><img src="http://maps.google.com/mapfiles/bar_icon_link.gif" alt="&lt;-&gt;" width="16" height="16"> <span>{'Link to this page'|@translate}</span></a>
+    <a id="aKml" href="" type="application/vnd.google-earth.kml+xml" class="gmnoprint"><img src="//maps.google.com/mapfiles/ms/view_as_kml.png" width="16" height="16" alt="kml"> <span>KML</span></a>
+    <a id="aLinkToThisPage" href="" class="gmnoprint"><img src="//maps.google.com/mapfiles/bar_icon_link.gif" alt="&lt;-&gt;" width="16" height="16"> <span>{'Link to this page'|@translate}</span></a>
     <a id="aBlowup" href="" onclick="return PwgDataHandler.blowupUrl(this.href);" class="gmnoprint" title="{'show all photos around this location'|@translate}">
 			<img src="{$PLUGIN_ROOT_URL}/icons/pic_s.gif" alt="" title="{'show all photos around this location'|@translate}">
Index: /extensions/rv_gmaps/trunk/template/page_linker.js
===================================================================
--- /extensions/rv_gmaps/trunk/template/page_linker.js	(revision 23082)
+++ /extensions/rv_gmaps/trunk/template/page_linker.js	(revision 23083)
@@ -28,8 +28,5 @@
 	vars['ll'] = map.getCenter().toUrlValue(5);
 	vars['z'] = map.getZoom();
-	if ( map.getMapTypeId()===google.maps.MapTypeId.ROADMAP )
-		{ if (vars['t']) vars['t']=null; }
-	else
-		vars['t']=map.getMapTypeId();
+	vars['t']=map.getMapTypeId();
 
 	var url = document.location.protocol+'//'+document.location.hostname+document.location.pathname;
Index: /extensions/rv_gmaps/trunk/template/picture_map_content.tpl
===================================================================
--- /extensions/rv_gmaps/trunk/template/picture_map_content.tpl	(revision 23082)
+++ /extensions/rv_gmaps/trunk/template/picture_map_content.tpl	(revision 23083)
@@ -1,4 +1,4 @@
 {html_head}
-<script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;language={$lang_info.code}" type="text/javascript"></script>
+<script src="//maps.googleapis.com/maps/api/js?sensor=false&amp;language={$lang_info.code}" type="text/javascript"></script>
 {combine_script id='jquery' load='header' path='themes/default/js/jquery.min.js'}
 {combine_script id='jquery.colorbox' load='async' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
@@ -45,5 +45,5 @@
 		zoom : 1,
 {/if}{literal}
-		mapTypeId: google.maps.MapTypeId.ROADMAP
+		mapTypeId: google.maps.MapTypeId.{/literal}{$MAP_TYPE}{literal}
 	};
 	
