[Mapbender-commits] r2970 - branches/nimix_dev/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 18 06:08:39 EDT 2008


Author: nimix
Date: 2008-09-18 06:08:39 -0400 (Thu, 18 Sep 2008)
New Revision: 2970

Modified:
   branches/nimix_dev/http/javascripts/mod_featureInfo.php
   branches/nimix_dev/http/javascripts/mod_featureInfoTunnel.php
Log:
put featureInfo handeling Code to the FI Modules

Modified: branches/nimix_dev/http/javascripts/mod_featureInfo.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_featureInfo.php	2008-09-18 09:30:13 UTC (rev 2969)
+++ branches/nimix_dev/http/javascripts/mod_featureInfo.php	2008-09-18 10:08:39 UTC (rev 2970)
@@ -18,7 +18,17 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+include '../include/dyn_js.php';
+//defaults for element vars
 ?>
+if(typeof(featureInfoLayerPopup)==='undefined')
+	var featureInfoLayerPopup = 'false';
+if(typeof(featureInfoPopupHeight)==='undefined')
+	var featureInfoPopupHeight = '200';
+if(typeof(featureInfoPopupWidth)==='undefined')
+	var featureInfoPopupWidth = '270';
+
 var mod_featureInfo_elName = "featureInfo1";
 var mod_featureInfo_frameName = "";
 var mod_featureInfo_target = "<?php echo $e_target[0]; ?>";
@@ -53,5 +63,36 @@
 		clickX = e.pageX;
 		clickY = e.pageY;
 	}
-	setFeatureInfoRequest(mod_featureInfo_target,clickX,clickY);
+	
+	var ind = getMapObjIndexByName(mod_featureInfo_target);
+	var point = new Point(clickX,clickY);
+	
+	if(document.getElementById("FeatureInfoRedirect")){
+		//fill the frames
+		for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+			var req = mb_mapObj[ind].wms[i].getFeatureInfoRequest(mb_mapObj[ind], point);
+			if(req)
+				window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[ind].wms[i].wms_id).src = req;
+		}
+	}
+	else{
+		urls = mb_mapObj[ind].getFeatureInfoRequests(point);
+		if(urls){
+			for(var i=0;i<urls.length;i++){
+				if(featureInfoLayerPopup == 'true'){
+					var p = new mb_popup({
+						title:"Feature Info",
+						url:urls[i],
+						width:parseInt(featureInfoPopupWidth, 10),
+						height:parseInt(featureInfoPopupHeight, 10),
+						top:200,
+						left:600
+					});
+				}
+				else
+					window.open(urls[i], "" , "width="+featureInfoPopupWidth+",height="+featureInfoPopupHeight+",scrollbars=yes,resizable=yes");
+			}
+		}
+	}
+	//setFeatureInfoRequest(mod_featureInfo_target,clickX,clickY);
 }
\ No newline at end of file

Modified: branches/nimix_dev/http/javascripts/mod_featureInfoTunnel.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_featureInfoTunnel.php	2008-09-18 09:30:13 UTC (rev 2969)
+++ branches/nimix_dev/http/javascripts/mod_featureInfoTunnel.php	2008-09-18 10:08:39 UTC (rev 2970)
@@ -18,7 +18,17 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+include '../include/dyn_js.php';
+//defaults for element vars
 ?>
+if(typeof(featureInfoLayerPopup)==='undefined')
+	var featureInfoLayerPopup = 'false';
+if(typeof(featureInfoPopupHeight)==='undefined')
+	var featureInfoPopupHeight = '200';
+if(typeof(featureInfoPopupWidth)==='undefined')
+	var featureInfoPopupWidth = '270';
+
 var mod_featureInfoTunnel_elName = "featureInfoTunnel";
 var mod_featureInfoTunnel_frameName = "";
 var mod_featureInfoTunnel_target = "<?php echo $e_target[0]; ?>";
@@ -54,5 +64,37 @@
 		clickX = e.pageX;
 		clickY = e.pageY;
 	}
-	setFeatureInfoRequest(mod_featureInfoTunnel_target,clickX,clickY, '../extensions/ext_featureInfoTunnel.php');
+
+	var ind = getMapObjIndexByName(mod_featureInfo_target);
+	var point = new Point(clickX,clickY);
+	var path = '../extensions/ext_featureInfoTunnel.php';
+	
+	if(document.getElementById("FeatureInfoRedirect")){
+		//fill the frames
+		for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+			var req = mb_mapObj[ind].wms[i].getFeatureInfoRequest(mb_mapObj[ind], point);
+			if(req)
+				window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[ind].wms[i].wms_id).src = path+"?url="+escape(req);
+		}
+	}
+	else{
+		urls = mb_mapObj[ind].getFeatureInfoRequests(point);
+		if(urls){
+			for(var i=0;i<urls.length;i++){
+				if(featureInfoLayerPopup == 'true'){
+					var p = new mb_popup({
+						title:"Feature Info",
+						url:path+"?url="+escape(urls[i]),
+						width:parseInt(featureInfoPopupWidth, 10),
+						height:parseInt(featureInfoPopupHeight, 10),
+						top:200,
+						left:600
+					});
+				}
+				else
+					window.open(path+"?url="+escape(urls[i]), "" , "width="+featureInfoPopupWidth+",height="+featureInfoPopupHeight+",scrollbars=yes,resizable=yes");
+			}
+		}
+	}	
+//	setFeatureInfoRequest(mod_featureInfoTunnel_target,clickX,clickY, '../extensions/ext_featureInfoTunnel.php');
 }
\ No newline at end of file



More information about the Mapbender_commits mailing list