[Mapbender-commits] r1351 - branches/redesign/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu May 24 10:58:41 EDT 2007


Author: uli
Date: 2007-05-24 10:58:41 -0400 (Thu, 24 May 2007)
New Revision: 1351

Added:
   branches/redesign/http/javascripts/mod_featureInfo_collect.php
Log:
a new featureInfo module

Added: branches/redesign/http/javascripts/mod_featureInfo_collect.php
===================================================================
--- branches/redesign/http/javascripts/mod_featureInfo_collect.php	                        (rev 0)
+++ branches/redesign/http/javascripts/mod_featureInfo_collect.php	2007-05-24 14:58:41 UTC (rev 1351)
@@ -0,0 +1,76 @@
+<?php
+# $Id: mod_featureInfo.php 842 2006-11-20 13:48:40Z christoph $
+# 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.
+include '../include/dyn_css.php';
+echo "mod_featureInfoResult = '".$featureInfoResult."';"
+?>
+var mod_featureInfo_elName = "featureInfo_collect";
+var mod_featureInfo_frameName = "";
+var mod_featureInfo_target = "<?php echo $e_target; ?>";
+
+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);
+	// TODO: CONSIDER NULL REQUESTS
+	if(mod_featureInfoResult == 'window'){		
+		mod_featureInfoResWin = window.open("../html/mod_blank.html", "mod_featureInfoResWin" , "width=300,height=400,scrollbars=yes,resizable=yes");
+		var doc = mod_featureInfoResWin.document;
+		for(i=0; i<myRequests.length;i++){
+			var resDiv = doc.createElement("div");
+			var resId = doc.createAttribute("id");
+			resId.nodeValue = "res"+i;
+			resDiv.setAttributeNode(resId);
+			doc.getElementsByTagName("body")[0].appendChild(resDiv);
+		}
+		for(i=0; i<myRequests.length;i++){
+			mb_ajax_post("../extensions/ext_featureInfoTunnel.php", {url:myRequests[i]}, function(result, status) {
+				doc.getElementById("res"+i).innerHTML = result;
+			}); 
+		}
+	}
+}
\ No newline at end of file



More information about the Mapbender_commits mailing list