[Mapbender-commits] r2894 - in trunk/mapbender/http: extensions
javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Aug 28 07:45:54 EDT 2008
Author: verenadiewald
Date: 2008-08-28 07:45:53 -0400 (Thu, 28 Aug 2008)
New Revision: 2894
Modified:
trunk/mapbender/http/extensions/ext_featureInfoTunnel.php
trunk/mapbender/http/javascripts/map.js
trunk/mapbender/http/javascripts/popup.js
Log:
control empty setFeatureInfo popups
Modified: trunk/mapbender/http/extensions/ext_featureInfoTunnel.php
===================================================================
--- trunk/mapbender/http/extensions/ext_featureInfoTunnel.php 2008-08-28 11:28:29 UTC (rev 2893)
+++ trunk/mapbender/http/extensions/ext_featureInfoTunnel.php 2008-08-28 11:45:53 UTC (rev 2894)
@@ -29,7 +29,8 @@
$x = new connector($nmr);
if (empty($x->file)) {
//close window if featureInfo has no result
- echo "<body onLoad=\"javascript:window.close()\">";
+ //echo "<body onLoad=\"javascript:window.close()\">";
+ echo "";
}
else {
echo $x->file;
Modified: trunk/mapbender/http/javascripts/map.js
===================================================================
--- trunk/mapbender/http/javascripts/map.js 2008-08-28 11:28:29 UTC (rev 2893)
+++ trunk/mapbender/http/javascripts/map.js 2008-08-28 11:45:53 UTC (rev 2894)
@@ -411,37 +411,57 @@
}
else if(path && validation){
newfeatureInfoRequest += requestParams;
- try{
- var p = new mb_popup({
- title:"Feature Info",
- url:path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,
- width:600,
- height:500,
- top:200,
- left:600
+ (function () {
+ var currentRequest = newfeatureInfoRequest;
+ mb_ajax_post(path, {'url':currentRequest},function(js_code,status){
+ if(js_code){
+ try{
+ var p = new mb_popup({
+ title:"Feature Info",
+ url:path + "?url=" + escape(currentRequest)+"&"+mb_nr,
+ width:600,
+ height:500,
+ top:200,
+ left:600
+ });
+ p.show();
+ }catch(e){
+ window.open(path + "?url=" + escape(currentRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
+ }
+ }
+ else{
+ var e = new Mb_exception("No featureInfo results.");
+ }
});
- p.show();
- }catch(e){
- window.open(path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
- }
+ }());
cnt_fi++;
}
else if(validation){
newfeatureInfoRequest += requestParams;
- try{
- var p = new mb_popup({
- title:"Feature Info",
- url:newfeatureInfoRequest,
- width:600,
- height:500,
- top:200,
- left:600
+ (function () {
+ var currentRequest = newfeatureInfoRequest;
+ mb_ajax_post(path,{url:currentRequest},function(js_code,status){
+ if(js_code){
+ try{
+ var p = new mb_popup({
+ title:"Feature Info",
+ url:currentRequest,
+ width:600,
+ height:500,
+ top:200,
+ left:600
+ });
+ p.show();
+ }
+ catch(e){
+ window.open(currentRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
+ }
+ }
+ else{
+ var e = new Mb_exception("No featureInfo results.");
+ }
});
- p.show();
- }
- catch(e){
- window.open(newfeatureInfoRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
- }
+ }());
cnt_fi++;
}
}
Modified: trunk/mapbender/http/javascripts/popup.js
===================================================================
--- trunk/mapbender/http/javascripts/popup.js 2008-08-28 11:28:29 UTC (rev 2893)
+++ trunk/mapbender/http/javascripts/popup.js 2008-08-28 11:45:53 UTC (rev 2894)
@@ -4,7 +4,7 @@
* License (>=v2). Read the file gpl.txt that comes with Mapbender for details.
*/
//http://www.mapbender.org/index.php/popup
-var popup_count = 0;
+var popup_count = 1;
var popup_top = 150;
/**
More information about the Mapbender_commits
mailing list