[Mapbender-commits] r3108 - branches/noframes/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Oct 3 09:17:48 EDT 2008
Author: nimix
Date: 2008-10-03 09:17:48 -0400 (Fri, 03 Oct 2008)
New Revision: 3108
Modified:
branches/noframes/http/javascripts/mod_featureInfoTunnel.php
Log:
move getFeatureInfo Code to the FI module
Modified: branches/noframes/http/javascripts/mod_featureInfoTunnel.php
===================================================================
--- branches/noframes/http/javascripts/mod_featureInfoTunnel.php 2008-10-03 13:13:09 UTC (rev 3107)
+++ branches/noframes/http/javascripts/mod_featureInfoTunnel.php 2008-10-03 13:17:48 UTC (rev 3108)
@@ -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,42 @@
clickX = e.pageX;
clickY = e.pageY;
}
- setFeatureInfoRequest(mod_featureInfoTunnel_target,clickX,clickY, '../extensions/ext_featureInfoTunnel.php');
+
+ eventBeforeFeatureInfo.trigger({"fName":mod_featureInfoTunnel_target});
+
+ var ind = getMapObjIndexByName(mod_featureInfoTunnel_target);
+ var point = new Point(clickX,clickY);
+ var path = '../extensions/ext_featureInfoTunnel.php';
+
+//TODO that code should go to featureInfo Redirect module
+ 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:<?php echo _mb("Informations");?>,
+ 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");
+ }
+ }
+ 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');
}
\ No newline at end of file
More information about the Mapbender_commits
mailing list