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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Nov 14 01:45:27 PST 2019


Author: armin11
Date: 2019-11-14 01:45:27 -0800 (Thu, 14 Nov 2019)
New Revision: 10328

Modified:
   trunk/mapbender/http/javascripts/mod_loadwmc.js
Log:
New option for the for the wmc loader to switch to full extent if the viewer has the resizeMapsize module enabled and a new elemen_var allowResize is set!

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js	2019-11-13 18:20:11 UTC (rev 10327)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js	2019-11-14 09:45:27 UTC (rev 10328)
@@ -1,9 +1,12 @@
 // set defaults
+
+
 options.checkLayerIdExists = options.checkLayerIdExists ? true : false;
 options.checkLayerIdValid = options.checkLayerIdValid ? true : false;
 options.checkLayerPermission = options.checkLayerPermission ? true : false;
 options.removeUnaccessableLayers = options.removeUnaccessableLayers ? options.removeUnaccessableLayers : 0;
 options.checkLayerAvailability = options.checkLayerAvailability ? true : false;
+options.allowResize = options.allowResize ? true : false;
 options.loadWmc = typeof options.loadWmc === "number" ? options.loadWmc : 1;
 options.mergeWmc = typeof options.mergeWmc === "number" ? options.mergeWmc : 0;
 options.appendWmc = typeof options.appendWmc === "number" ? options.appendWmc : 0;
@@ -181,6 +184,7 @@
 		// the pop up allows you to load, append, merge,
 		// display and delete WMC documents
 		if (tagName === "IMG") {
+//alert("show initial table with img");
 			if($wmcPopup) {
 				$wmcPopup.dialog('destroy');
 				$wmcPopup.remove();
@@ -201,6 +205,7 @@
 			}).parent().css({position:"absolute"});
 		}
 		else {
+//alert("show initial table without img");
 			$loadWmc.html(getInitialDialogHtml(options.id));
 		}
 
@@ -220,6 +225,7 @@
 		that.hideOpenLayers();
 		that.hideApiList();
 		that.hideApiUrl();
+                //that.hideDialogFromButton();
 	};
 
 	this.showWmcXml = function (id) {
@@ -243,6 +249,12 @@
 			$('.wmcDisplayPopup').remove();
 		}
 	};
+	this.hideDialogFromButton = function () {
+		if($('.loadwmc-dialog').size() > 0) {
+			$('.loadwmc-dialog').dialog('destroy');
+			//$('.loadwmc-dialog').remove();
+		}
+	};
 	//next function is obsolete
 	this.showOpenLayers = function (id) {
 		that.hideDependendWindows();
@@ -486,8 +498,17 @@
 							//alert("Statement: " + obj.javascript[j]);
 							//eventAfterLoadWMS.trigger(); -- load the each wms again and saves the wmc to session for each wms - prohibit this behaviour!!!! - Done by global lock_maprequest in class_wmc.php line 1220+!!
 							//console.log("Statement: " + obj.javascript[j]);
-							eval(obj.javascript[j]);
+							eval(obj.javascript[j]);                                           
 						}
+
+						if (options.allowResize == true) {
+						    if (Mapbender.modules.resizeMapsize) {
+						        //alert("Module resizeMapsize is available!");
+						        try {$('#resizeMapsize').trigger("click");} catch (e) {alert(e)};
+						    }
+						} else {
+						    //alert("allowResize not defined");
+						}
 						if (args.method === "loadWmc" || args.method === 'loadWmcFromFile') {
                                                     var kml = $('#mapframe1').data('kml');
                                                     if(kml) {



More information about the Mapbender_commits mailing list