[Mapbender-commits] r7123 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 15 05:56:13 EST 2010


Author: christoph
Date: 2010-11-15 02:56:13 -0800 (Mon, 15 Nov 2010)
New Revision: 7123

Modified:
   trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js
Log:
check if options are set before accessing them

Modified: trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js	2010-11-15 10:31:53 UTC (rev 7122)
+++ trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js	2010-11-15 10:56:13 UTC (rev 7123)
@@ -94,6 +94,7 @@
 }
 
 var mod_addWms_general = function (js, param) {
+
 	var success = false;
 	if (js) {
 		var oldWmsCount = wms.length;
@@ -105,7 +106,7 @@
 			var ind = getMapObjIndexByName('mapframe1');
 			var map = mb_mapObj[ind];
 			var lastwms = map.wms[map.wms.length - 1];
-			if (typeof param.options.zoomToExtent === "number" && param.options.zoomToExtent === 1) {
+			if (param && param.options && typeof param.options.zoomToExtent === "number" && param.options.zoomToExtent === 1) {
 				// zoom to bbox
 				var bbox_minx, bbox_miny, bbox_maxx, bbox_maxy;
 				for (var i = 0; i < lastwms.gui_epsg.length; i++) {



More information about the Mapbender_commits mailing list