[Mapbender-commits] r2893 - in branches/2.5/http: extensions javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Aug 28 07:28:29 EDT 2008


Author: verenadiewald
Date: 2008-08-28 07:28:29 -0400 (Thu, 28 Aug 2008)
New Revision: 2893

Modified:
   branches/2.5/http/extensions/ext_featureInfoTunnel.php
   branches/2.5/http/javascripts/map.js
   branches/2.5/http/javascripts/popup.js
Log:
control empty setFeatureInfo popups 

Modified: branches/2.5/http/extensions/ext_featureInfoTunnel.php
===================================================================
--- branches/2.5/http/extensions/ext_featureInfoTunnel.php	2008-08-27 12:36:13 UTC (rev 2892)
+++ branches/2.5/http/extensions/ext_featureInfoTunnel.php	2008-08-28 11:28:29 UTC (rev 2893)
@@ -29,7 +29,8 @@
 	$x = new connector($nmr);
 	if (empty($x->file)) {
 		//close window if featureInfo has no result
-		echo "<body onLoad=\"javascript:window.close()\">";
+		//echo "<body onLoad=\"javascript:window.close()\">";
+		echo "";
 	} 
 	else {
 		echo $x->file;

Modified: branches/2.5/http/javascripts/map.js
===================================================================
--- branches/2.5/http/javascripts/map.js	2008-08-27 12:36:13 UTC (rev 2892)
+++ branches/2.5/http/javascripts/map.js	2008-08-28 11:28:29 UTC (rev 2893)
@@ -1021,37 +1021,57 @@
             	}
 				else if(path && validation){
 					newfeatureInfoRequest += requestParams;
-					try{
-						var p = new mb_popup({
-							title:"Feature Info",
-							url:path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,
-							width:600,
-							height:500,
-							top:200,
-							left:600
+					(function () {
+						var currentRequest = newfeatureInfoRequest;
+						mb_ajax_post(path, {'url':currentRequest},function(js_code,status){
+							if(js_code){
+								try{
+									var p = new mb_popup({
+										title:"Feature Info",
+										url:path + "?url=" + escape(currentRequest)+"&"+mb_nr,
+										width:600,
+										height:500,
+										top:200,
+										left:600
+									});
+									p.show();
+								}catch(e){
+									window.open(path + "?url=" + escape(currentRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
+								}
+							}
+							else{
+								var e = new Mb_exception("No featureInfo results.");
+							}
 						});
-						p.show();
-					}catch(e){
-						window.open(path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
-					}
+					}());
 					cnt_fi++;
 				}
 				else if(validation){
 					newfeatureInfoRequest += requestParams;
-					try{
-						var p = new mb_popup({
-							title:"Feature Info",
-							url:newfeatureInfoRequest,
-							width:600,
-							height:500,
-							top:200,
-							left:600
+					(function () {
+						var currentRequest = newfeatureInfoRequest;
+						mb_ajax_post(path,{url:currentRequest},function(js_code,status){
+							if(js_code){
+								try{
+									var p = new mb_popup({
+										title:"Feature Info",
+										url:currentRequest,
+										width:600,
+										height:500,
+										top:200,
+										left:600
+									});
+									p.show();
+								}
+								catch(e){
+									window.open(currentRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");					
+								}		
+							}
+							else{
+								var e = new Mb_exception("No featureInfo results.");					
+							}
 						});
-						p.show();
-					}
-					catch(e){
-						window.open(newfeatureInfoRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");					
-					}
+					}());
 					cnt_fi++;
 				}    
 			}

Modified: branches/2.5/http/javascripts/popup.js
===================================================================
--- branches/2.5/http/javascripts/popup.js	2008-08-27 12:36:13 UTC (rev 2892)
+++ branches/2.5/http/javascripts/popup.js	2008-08-28 11:28:29 UTC (rev 2893)
@@ -4,7 +4,7 @@
 * License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
 */
 //http://www.mapbender.org/index.php/popup
-var popup_count = 0;
+var popup_count = 1;
 var popup_top = 150;
 
 /**



More information about the Mapbender_commits mailing list