[Mapbender-commits] r8695 - in trunk/mapbender/http: html javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 26 07:20:08 PDT 2013


Author: verenadiewald
Date: 2013-08-26 07:20:08 -0700 (Mon, 26 Aug 2013)
New Revision: 8695

Modified:
   trunk/mapbender/http/html/mod_treefolderPlain.php
   trunk/mapbender/http/javascripts/map_obj.js
Log:
handle service exceptions of getMap requests (imgerror) in treeGDE

Modified: trunk/mapbender/http/html/mod_treefolderPlain.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolderPlain.php	2013-08-23 06:15:55 UTC (rev 8694)
+++ trunk/mapbender/http/html/mod_treefolderPlain.php	2013-08-26 14:20:08 UTC (rev 8695)
@@ -223,7 +223,9 @@
 //parent.eventMapRequestFailed.register(function(t){imgerror(t)});
 
 eventAfterLoadWMS.register(reloadTree);
-eventAfterLoadWMS.register(registerInitMapCheck);
+
+eventInit.register(registerInitMapCheck);
+
 Mapbender.events.init.register(function () {
 	$("#" + mod_treeGDE_map).mapbender().events.afterMoveWms.register(reloadTree);
 });
@@ -412,18 +414,24 @@
 	Mapbender.events.treeReloaded.trigger();
 }
 
-function imgerror(t){
+function imgerror(wms, path, imgObj){
 	var map= getMapObjIndexByName(mod_treeGDE_map);
-	var wms=Number(t.id.substr(4));
-	t.onerror=null;
-	t.onabort=null;
+	//t.onerror=null;
+	//t.onabort=null;
 	if(state[wms]!=-1 && alerterror=='true'){
 		state[wms]=-1;
-		if(confirm('<?php echo _mb("Failed to load WMS");?> ' +
+		
+		var errorMsg = '<?php echo _mb("Failed to load WMS");?> ' + mb_mapObj[map].wms[wms].objLayer[0].layer_currentTitle;
+		$('<div id="imgErrorDialog">' + errorMsg + ':<iframe style="width:90%;height:90%;" src="' + imgObj.attr("src") + '"></iframe></div>').dialog();
+		
+		checkNode(path, 0, false);
+		
+		/*if(confirm('<?php echo _mb("Failed to load WMS");?> ' +
 			mb_mapObj[map].wms[wms].objLayer[0].layer_currentTitle +
 			'\n<?php echo _mb("Do you want to try to load it in a new window?");?>')) {
-			window.open(t.src,"");
+			window.open(imgObj.attr("src"),"");
 		}
+		*/
 	}
 	state[wms]=-1;
 	errors++;
@@ -456,8 +464,10 @@
 	else{
 		if(first){
 			state[wms]=0;
-//			 frames[mod_treeGDE_map].document.getElementById(map).onerror=imgerror;
-//			 frames[mod_treeGDE_map].document.getElementById(map).onabort=imgerror;
+			$("#" + map).error(function () {
+				imgerror(wms, img, $(this));
+			});
+			//$(map).onabort=imgerror;
 
 			if(showstatus=='true')
 				setNodeImage(img, "loading_folder.gif");

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2013-08-23 06:15:55 UTC (rev 8694)
+++ trunk/mapbender/http/javascripts/map_obj.js	2013-08-26 14:20:08 UTC (rev 8695)
@@ -879,7 +879,8 @@
             url += "TRANSPARENT=TRUE&";
         }
         
-        url += "EXCEPTIONS=" + currentWms.gui_wms_exceptionformat + "&";
+        //url += "EXCEPTIONS=" + currentWms.gui_wms_exceptionformat + "&";
+        url += "EXCEPTIONS=application/vnd.ogc.se_xml&";
         
         // add vendor-specific
 		for (var v = 0; v < mb_vendorSpecific.length; v++) {



More information about the Mapbender_commits mailing list