[Mapbender-commits] r1445 - branches/mapbender_sld/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 11 05:16:37 EDT 2007


Author: uli
Date: 2007-06-11 05:16:37 -0400 (Mon, 11 Jun 2007)
New Revision: 1445

Added:
   branches/mapbender_sld/http/javascripts/mod_featureInfo_collect.php
Log:
first check in


Added: branches/mapbender_sld/http/javascripts/mod_featureInfo_collect.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_featureInfo_collect.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_featureInfo_collect.php	2007-06-11 09:16:37 UTC (rev 1445)
@@ -0,0 +1,100 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_featureInfo.php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/*
+ * element_var: mod_featureInfoResult: Type (one window, each request in a separate window etc.)
+ * element_var: mod_featureInfoMsg: Message if now Querylayer is activated
+ * element_var: mod_featureInfoTunnel: the path to the tunnel module (Todo)
+ * element_var: mod_featureInfoCount: the wms-parameter feature_count (Todo)
+ */
+
+// further element_vars: feature_count, window.width, window.height
+
+$gui_id = $_REQUEST["gui_id"];
+include '../include/dyn_js.php';
+
+?>
+var mod_featureInfo_elName = "featureInfo_collect";
+var mod_featureInfo_frameName = "";
+var mod_featureInfo_target = "<?php echo $e_target; ?>";
+var mod_featureInfoResWin = false;
+
+var mod_featureInfo_img_on = new Image(); mod_featureInfo_img_on.src =  "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
+var mod_featureInfo_img_off = new Image(); mod_featureInfo_img_off.src ="<?php  echo $e_src;  ?>";
+var mod_featureInfo_img_over = new Image(); mod_featureInfo_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+
+function init_featureInfo1(ind){
+	mb_button[ind] = document.getElementById(mod_featureInfo_elName);
+	mb_button[ind].img_over = mod_featureInfo_img_over.src;
+	mb_button[ind].img_on = mod_featureInfo_img_on.src;
+	mb_button[ind].img_off = mod_featureInfo_img_off.src;
+	mb_button[ind].status = 0;
+	mb_button[ind].elName = mod_featureInfo_elName;
+	mb_button[ind].fName = mod_featureInfo_frameName;
+	mb_button[ind].go = new Function ("mod_featureInfo_click()");
+	mb_button[ind].stop = new Function ("mod_featureInfo_disable()");
+}
+function mod_featureInfo_click(){   
+	window.frames[mod_featureInfo_target].document.onclick = mod_featureInfo_event;
+}
+function mod_featureInfo_disable(){
+	window.frames[mod_featureInfo_target].document.onclick = null;
+}
+function mod_featureInfo_event(e){
+	if(ie){
+		clickX = window.frames[mod_featureInfo_target].event.clientX;
+		clickY = window.frames[mod_featureInfo_target].event.clientY;
+	}
+	else{
+		clickX = e.pageX;
+		clickY = e.pageY;
+	}
+	var clickPoint = new Point(clickX,clickY);
+	var myObj = getMapObjByName(mod_featureInfo_target);
+	var myRequests = myObj.getFeatureInfoRequests(clickPoint);
+	if(myRequests.length == 0){
+		return false;
+	}
+	if(mod_featureInfoResult == 'window'){		
+		if(!mod_featureInfoResWin || mod_featureInfoResWin.closed == true){
+			mod_featureInfoResWin = window.open("../html/mod_blank.html", "mod_featureInfoResWin" , "width=300,height=400,scrollbars=yes,resizable=yes,dependent=yes");
+		}
+		else{
+			mod_featureInfoResWin.document.getElementsByTagName("body")[0].innerHTML = "";
+			mod_featureInfoResWin.focus();
+			console.log("focus");
+		}
+		var doc = mod_featureInfoResWin.document;
+		if(myRequests.length === 0){
+			alert(mod_featureInfoMsg);
+		}
+		for(i=0; i<myRequests.length;i++){
+			mb_ajax_post("../extensions/ext_featureInfoTunnel.php", {url:myRequests[i]}, function(result, status) {
+				var doc = mod_featureInfoResWin.document;
+				var resDiv = doc.createElement("div");
+				var resId = doc.createAttribute("id");
+				resId.nodeValue = "res"+i;
+				resDiv.setAttributeNode(resId);
+				resDiv.innerHTML = 'hallo';
+				doc.getElementsByTagName("body")[0].appendChild(resDiv);
+				doc.getElementById("res"+i).innerHTML = result;
+			}); 
+		}		
+	}
+}
\ No newline at end of file


Property changes on: branches/mapbender_sld/http/javascripts/mod_featureInfo_collect.php
___________________________________________________________________
Name: svn:keywords
   + HeadURL Id LastChangedBy LastChangedDate LastChangedRevision



More information about the Mapbender_commits mailing list