[Mapbender-commits] r6636 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 26 05:57:55 EDT 2010


Author: kmq
Date: 2010-07-26 09:57:55 +0000 (Mon, 26 Jul 2010)
New Revision: 6636

Modified:
   trunk/mapbender/lib/mb.ui.displayFeatures.js
Log:
added errorhandling for loading urls in georss widget

Modified: trunk/mapbender/lib/mb.ui.displayFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayFeatures.js	2010-07-26 09:44:35 UTC (rev 6635)
+++ trunk/mapbender/lib/mb.ui.displayFeatures.js	2010-07-26 09:57:55 UTC (rev 6636)
@@ -147,19 +147,25 @@
 
 	_load : function(url){
 		var that = this, o = this.options;
+		var LoadError = function(message){
+				$("<div class='labelLoadError'>"+ translatedI18nObject.labelLoadError +"</div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close");  }} });	
+		};
 		$.ajax({ url: that._endpointURL,
 			data: {url: o.url},
 			type: 'POST',
 			dataType: "json",
 			success : function(data,textStatus,xhr){
+				if(!data){
+					loadError('request returned no data');
+				};
 				if(data.errorMessage){
-					$("<div class='labelLoadError'>ERROR<div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close"); } } } );
+					loadError(data.errorMessage);
 					return;
 				}
 				that._display(data);
 			},
 			error: function(XMLHttpRequest, textStatus, errorThrown){
-				$("<div class='labelLoadError'>"+ translatedI18nObject.labelLoadError +"</div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close");  }} });	
+				loadError("could not load "+o.url);
 			}
 		});
 



More information about the Mapbender_commits mailing list