[Mapbender-commits] r1367 - branches/redesign/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri May 25 10:44:55 EDT 2007
Author: uli
Date: 2007-05-25 10:44:55 -0400 (Fri, 25 May 2007)
New Revision: 1367
Modified:
branches/redesign/http/javascripts/map.php
branches/redesign/http/javascripts/map_obj.js
branches/redesign/http/javascripts/mod_featureInfo_collect.php
Log:
Modified: branches/redesign/http/javascripts/map.php
===================================================================
--- branches/redesign/http/javascripts/map.php 2007-05-25 14:26:37 UTC (rev 1366)
+++ branches/redesign/http/javascripts/map.php 2007-05-25 14:44:55 UTC (rev 1367)
@@ -221,7 +221,10 @@
var allRequests = [];
//loop through all wms to get the FeatureInfoRequests
for(var i=0; i<this.wms.length; i++){
- allRequests.push(this.wms[i].getFeatureInfoRequest(this, clickPoint));
+ var currentRequest = this.wms[i].getFeatureInfoRequest(this, clickPoint);
+ if(currentRequest){
+ allRequests.push(currentRequest);
+ }
}
if(allRequests.length > 0){
return allRequests;
Modified: branches/redesign/http/javascripts/map_obj.js
===================================================================
--- branches/redesign/http/javascripts/map_obj.js 2007-05-25 14:26:37 UTC (rev 1366)
+++ branches/redesign/http/javascripts/map_obj.js 2007-05-25 14:44:55 UTC (rev 1367)
@@ -131,7 +131,7 @@
rq += "&EXCEPTIONS=application/vnd.ogc.se_xml";
rq += "&X=" + clickPoint.x;
rq += "&Y=" + clickPoint.y;
-
+ return rq;
//TODO: handle FEATURE_COUNT AS ELEMENT_VAR IN EACH MODULE
// if(mb_feature_count > 0){
// rq += "FEATURE_COUNT="+mb_feature_count+"&";
Modified: branches/redesign/http/javascripts/mod_featureInfo_collect.php
===================================================================
--- branches/redesign/http/javascripts/mod_featureInfo_collect.php 2007-05-25 14:26:37 UTC (rev 1366)
+++ branches/redesign/http/javascripts/mod_featureInfo_collect.php 2007-05-25 14:44:55 UTC (rev 1367)
@@ -16,8 +16,15 @@
# 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."';"
+
+/*
+ * element_var: mod_featureInfoResult: Type (one window, each request in a separate window etc.)
+ */
+
+// 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 = "";
@@ -44,6 +51,7 @@
function mod_featureInfo_disable(){
window.frames[mod_featureInfo_target].document.onclick = null;
}
+mod_featureInfoResWin = false;
function mod_featureInfo_event(e){
if(ie){
clickX = window.frames[mod_featureInfo_target].event.clientX;
@@ -56,21 +64,30 @@
var clickPoint = new Point(clickX,clickY);
var myObj = getMapObjByName(mod_featureInfo_target);
var myRequests = myObj.getFeatureInfoRequests(clickPoint);
- // TODO: CONSIDER NULL REQUESTS
+ if(myRequests.length == 0){
+ return false;
+ }
if(mod_featureInfoResult == 'window'){
- mod_featureInfoResWin = window.open("../html/mod_blank.html", "mod_featureInfoResWin" , "width=300,height=400,scrollbars=yes,resizable=yes");
+ 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;
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) {
+ 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
+}
More information about the Mapbender_commits
mailing list