[Mapbender-commits] r3638 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Mar 6 08:31:50 EST 2009


Author: verenadiewald
Date: 2009-03-06 08:31:49 -0500 (Fri, 06 Mar 2009)
New Revision: 3638

Modified:
   trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php
Log:
bug fix show popup + don't show windows or popups if featureInfo is empty

Modified: trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php	2009-03-06 09:07:18 UTC (rev 3637)
+++ trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php	2009-03-06 13:31:49 UTC (rev 3638)
@@ -57,14 +57,13 @@
 	mod_featureInfoTunnel_map.getDomElement().onclick = null;
 }
 function mod_featureInfoTunnel_event(e){
-	mod_featureInfoTunnel_map.getMousePos(e);
-
 	eventBeforeFeatureInfo.trigger({"fName":mod_featureInfoTunnel_target});
 
 	var point = mod_featureInfoTunnel_map.getMousePos(e);
 	var path = '../extensions/ext_featureInfoTunnel.php';
 	
 //TODO that code should go to featureInfo Redirect module
+	var ind = getMapObjIndexByName(mod_featureInfoTunnel_target);
 	if(document.getElementById("FeatureInfoRedirect")){
 		//fill the frames
 		for(var i=0; i<mod_featureInfoTunnel_map.wms.length; i++){
@@ -77,22 +76,33 @@
 		urls = mod_featureInfoTunnel_map.getFeatureInfoRequests(point);
 		if(urls){
 			for(var i=0;i<urls.length;i++){
-				if(featureInfoLayerPopup == 'true'){
-					var p = new mb_popup({
-						title:<?php echo _mb("Informations");?>,
-						url:path+"?url="+escape(urls[i]),
-						width:parseInt(featureInfoPopupWidth, 10),
-						height:parseInt(featureInfoPopupHeight, 10),
-						top:200,
-						left:600
+				(function () {
+					var currentRequest = escape(urls[i]);
+					mb_ajax_post(path, {'url':currentRequest},function(js_code,status){
+						if(js_code){
+							if(featureInfoLayerPopup == 'true'){
+								var p = new mb_popup({
+									title:"Information",
+									url:path+"?url="+currentRequest,
+									width:parseInt(featureInfoPopupWidth, 10),
+									height:parseInt(featureInfoPopupHeight, 10),
+									top:200 + i*25,
+									left:600 + i*25
+								});
+								p.show();
+							}
+							else{
+								window.open(path+"?url="+currentRequest, "" , "width="+featureInfoPopupWidth+",height="+featureInfoPopupHeight+",scrollbars=yes,resizable=yes");
+							}
+						}
+						else{
+                            var e = new Mb_exception("No featureInfo results.");
+                         }
 					});
-				}
-				else
-					window.open(path+"?url="+escape(urls[i]), "" , "width="+featureInfoPopupWidth+",height="+featureInfoPopupHeight+",scrollbars=yes,resizable=yes");
+				}());
 			}
 		}
 		else
 			alert(unescape("Please select a layer! \n Bitte waehlen Sie eine Ebene zur Abfrage aus!"));
 	}	
-//	setFeatureInfoRequest(mod_featureInfoTunnel_target,clickX,clickY, '../extensions/ext_featureInfoTunnel.php');
 }



More information about the Mapbender_commits mailing list