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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 23 12:16:52 EDT 2008


Author: christoph
Date: 2008-06-23 12:16:52 -0400 (Mon, 23 Jun 2008)
New Revision: 2545

Modified:
   trunk/mapbender/lib/core.js
   trunk/mapbender/lib/div.js
Log:


Modified: trunk/mapbender/lib/core.js
===================================================================
--- trunk/mapbender/lib/core.js	2008-06-23 16:13:23 UTC (rev 2544)
+++ trunk/mapbender/lib/core.js	2008-06-23 16:16:52 UTC (rev 2545)
@@ -18,6 +18,11 @@
 var eventAfterMapRequest = new MapbenderEvent();
 
 /**
+ * Triggered after aall map images have been loaded.
+ */
+var eventAfterMapImagesReady = new MapbenderEvent();
+
+/**
  * Triggered before a map is requested.
  */
 var eventBeforeMapRequest = new MapbenderEvent();
@@ -31,7 +36,54 @@
  * Triggered before a feature info is requested.
  */
 var eventBeforeFeatureInfo = new MapbenderEvent();
+eventBeforeFeatureInfo.register(function() {
+	for (var j=0; j<mb_mapObj.length; j++) {
+		var mapObj = mb_mapObj[j];
 
+		//
+		// set list of visible layers, active querylayers 
+		// and styles for each WMS in this map
+		//
+		
+		var cnt_layers;
+		var cnt_querylayers;
+		var styles;
+		var layers;
+		var querylayers = "";
+		for(i=0; i< mapObj.wms.length; i++){
+			cnt_layers = 0;
+			cnt_querylayers = 0;
+			styles = "";
+			layers = "";
+			querylayers = "";
+	
+			for(var ii=0; ii<mapObj.wms[i].objLayer.length; ii++){
+				// layer is visible and not root layer
+				if(mapObj.wms[i].objLayer[ii].gui_layer_visible == 1 && ii>0){
+					if(cnt_layers > 0){
+						layers += ","; styles += ","; 
+					}
+					layers += wms[i].objLayer[ii].layer_name; 
+					styles += ""; 
+					cnt_layers++;
+				}            
+				// layer is queryable and not root layer
+				if(mapObj.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
+					if(cnt_querylayers > 0){
+						querylayers += ",";
+					}
+					querylayers += wms[i].objLayer[ii].layer_name; 
+					cnt_querylayers++;
+				}                          
+			}
+			mapObj.layers[i] = layers;
+			mapObj.styles[i] = styles;
+			mapObj.querylayers[i] = querylayers;
+		}
+		
+	}
+	
+});
 /**
  * Triggered after a WMS has been loaded.
  */
@@ -43,6 +95,12 @@
 var eventInit = new MapbenderEvent();
 
 /**
+ * Triggered after Mapbender is loaded and has been initialised.
+ * Used to trigger initial map requests
+ */
+var eventAfterInit = new MapbenderEvent();
+
+/**
  * Initializes the map object. Triggered when Mapbender is loaded. 
  */
 var eventInitMap = new MapbenderEvent();
@@ -164,6 +222,19 @@
 }
 
 /**
+ * Called in index.php on body onload
+ */
+function init() {
+	// creates the map objects (mapframe1, overview...)
+	eventInitMap.trigger();
+
+	// initialisation
+	eventInit.trigger();
+	
+	eventAfterInit.trigger();
+}
+
+/**
  * deprecated function for writing content within a tag via innerHTML
  * @deprecated
  */

Modified: trunk/mapbender/lib/div.js
===================================================================
--- trunk/mapbender/lib/div.js	2008-06-23 16:13:23 UTC (rev 2544)
+++ trunk/mapbender/lib/div.js	2008-06-23 16:16:52 UTC (rev 2545)
@@ -4,13 +4,6 @@
 * License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
 */
 
-
-/*
- ***************************************************************************************
- *   div tag
- ***************************************************************************************
- */
-
 /**
  * @class Represents a div tag. May be located in any frame of Mapbender.
  * 



More information about the Mapbender_commits mailing list