Index: extensions/rv_gmaps/trunk/map.php
===================================================================
--- extensions/rv_gmaps/trunk/map.php	(revision 25921)
+++ extensions/rv_gmaps/trunk/map.php	(revision 25922)
@@ -54,5 +54,5 @@
   rvm_build_section_items($img_fields, null, RVM_BUILD_AGGREGATE);
   //var_export( $page['items'] );
-  if ( count($page['items']) )
+  if ( isset($page['items'][0]['s']) )
     $template->assign('initial_bounds', $page['items'][0] );
   unset( $page['items'] );
Index: extensions/rv_gmaps/trunk/template/map.tpl
===================================================================
--- extensions/rv_gmaps/trunk/template/map.tpl	(revision 25921)
+++ extensions/rv_gmaps/trunk/template/map.tpl	(revision 25922)
@@ -25,16 +25,14 @@
 <![endif]-->
 
-<script type="text/javascript">{literal}
+<script type="text/javascript">
 //<![CDATA[
 var map;
 
 document.is_debug = false;
-if ( document.location.search.match(/[\?&]debug/) ) {
+if ( document.location.search.match(/[\?&]debug/) )
 	document.is_debug = true;
-}
 
 function glog(msg) {
-	if (console)
-	{
+	if (console) {
 		var b = map.getBounds();
 		if (b)
@@ -52,12 +50,11 @@
 {
 	var mapOptions = {
-		mapTypeId: google.maps.MapTypeId.{/literal}{$MAP_TYPE}{literal},
+		mapTypeId: google.maps.MapTypeId.{$MAP_TYPE},
 		overviewMapControl: true,
-		overviewMapControlOptions: {opened: document.documentElement.offsetWidth>640}
+		overviewMapControlOptions: { opened: document.documentElement.offsetWidth>640}
 	}
 
 	if (!PageLinker.url2Map(mapOptions))
 	{
-{/literal}
 {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}) );
@@ -67,5 +64,4 @@
 		mapOptions.zoom = 2;
 {/if}
-{literal}
 	}
 
@@ -75,21 +71,19 @@
 		map.fitBounds(mapOptions.iniBounds);
 
-	if (document.is_debug)
-	{
-		google.maps.event.addListener(map, "idle", function() { glog("idle"); });
-		google.maps.event.addListener(map, "bounds_changed", function() { glog("bounds_changed");} );
-		google.maps.event.addListener(map, "center_changed", function() { glog("center_changed");} );
-		google.maps.event.addListener(map, "maptypeid_changed", function() { glog("maptypeid_changed");} );
-		google.maps.event.addListener(map, "zoom_changed", function() { glog("zoom_changed");} );
-		google.maps.event.addListener(map, "drag", function() { glog("drag");} );
-	}
-
+{if isset($smarty.get.debug)}
+	google.maps.event.addListener(map, "idle", function() { glog("idle"); });
+	google.maps.event.addListener(map, "bounds_changed", function() { glog("bounds_changed");} );
+	google.maps.event.addListener(map, "center_changed", function() { glog("center_changed");} );
+	google.maps.event.addListener(map, "maptypeid_changed", function() { glog("maptypeid_changed");} );
+	google.maps.event.addListener(map, "zoom_changed", function() { glog("zoom_changed");} );
+	google.maps.event.addListener(map, "drag", function() { glog("drag");} );
+{/if}
 	pwgPageLinker = new PageLinker(map, "aLinkToThisPage" );
 
-	var pwgStyler = {/literal}{$MAP_MARKER_ICON_JS}{literal};
+	var pwgStyler = {$MAP_MARKER_ICON_JS};
 
-	map.pwgDataLoader = new PwgDataLoader(map, {rectangle_of_confusion: pwgStyler.roc} );
+	map.pwgDataLoader = new PwgDataLoader(map, { rectangle_of_confusion: pwgStyler.roc} );
 	google.maps.event.addListener(map.pwgDataLoader, "dataloading", function() {
-		var pre = '<img src="{/literal}{$PLUGIN_ROOT_URL}{literal}/icons/progress_s.gif" width="16" height="16" alt="~"> ';
+		var pre = '<img src="{$PLUGIN_ROOT_URL}/icons/progress_s.gif" width="16" height="16" alt="~"> ';
 		document.getElementById("dataLoadStatus").innerHTML = pre + Localization.get("Loading");
 		}
@@ -101,8 +95,8 @@
 		);
 
-	map.pwgDataHandler = new PwgDataHandler(map, {styler: pwgStyler, show_all_img_src: "{/literal}{$PLUGIN_ROOT_URL}{literal}/icons/pic_s.gif" } );
+	map.pwgDataHandler = new PwgDataHandler(map, { styler: pwgStyler, show_all_img_src: "{$PLUGIN_ROOT_URL}/icons/pic_s.gif" } );
 	google.maps.event.addListener(map.pwgDataLoader, "dataloaded", pwgBind(map.pwgDataHandler, map.pwgDataHandler.handle) );
 
-	map.pwgDataLoader.start( "{/literal}{$U_MAP_DATA}{literal}" );
+	map.pwgDataLoader.start( "{$U_MAP_DATA}" );
 
 	positionMap();
@@ -134,5 +128,4 @@
 {
   _strings: {
-{/literal}
 "go to %s": "{'go to %s'|@translate|@escape:javascript}",
 "Next": "{'Next'|@translate|@escape:javascript}",
@@ -146,5 +139,4 @@
 "opens %s in Google Earth" : "{'opens %s in Google Earth'|@translate|@escape:javascript}",
 "%d photos" : "{'%d photos'|@translate|@escape:javascript}",
-{literal}
 dontMindTheComma: ""
     },
@@ -172,5 +164,4 @@
 	}
 }
-{/literal}
 //]]>
 </script>
@@ -188,5 +179,5 @@
 		<a id="aLinkToThisPage" href="" class="gmnoprint"><img src="//maps.google.com/mapfiles/bar_icon_link.gif" alt="&lt;-&gt;" width="16" height="16"><span class="hideable"> {'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}">
+			<img src="{$PLUGIN_ROOT_URL}/icons/pic_s.gif" width="16" height="16" alt="" title="{'show all photos around this location'|@translate}">
 			<span>{'Show all'|@translate}</span>
 		</a>
