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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Feb 25 04:29:33 EST 2010


Author: christoph
Date: 2010-02-25 04:29:31 -0500 (Thu, 25 Feb 2010)
New Revision: 5646

Modified:
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
documentation

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2010-02-25 07:53:44 UTC (rev 5645)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2010-02-25 09:29:31 UTC (rev 5646)
@@ -1,9 +1,4 @@
 <?php
-# License:
-# Copyright (c) 2009, Open Source Geospatial Foundation
-# This program is dual licensed under the GNU General Public License 
-# and Simplified BSD license.  
-# http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
 
 require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
 
@@ -25,6 +20,68 @@
 ?>
 <script type='text/javascript' src='../extensions/jquery-ui-1.7.2.custom/js/jquery-1.3.2.min.js'></script>
 <script type='text/javascript'>
+/**
+ * Package: digitize
+ *
+ * Description:
+ * Allows the user to digitize polygons, lines and points.
+ * 
+ * Files:
+ *  - http/javascripts/mod_digitize_tab.php
+ *  - http/php/mod_digitize_messages.php
+ *  - http/css/digitize.css
+ *  - conf/digitize_default.conf
+ *
+ * SQL:
+ * > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, 
+ * > e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, 
+ * > e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, 
+ * > e_mb_mod, e_target, e_requires, e_url) VALUES ('<appId>','digitize',
+ * > 2,1,'Digitize tool.','Digitize','iframe',
+ * > '../javascripts/mod_digitize_tab.php?sessionID','frameborder = "0" ',
+ * > 1,1,1,1,5,'','','iframe','','geometry.js','mapframe1','mapframe1',
+ * > 'http://www.mapbender.org/Digitize');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
+ * > var_value, context, var_type) VALUES('<appId>', 'digitize', 'cssUrl', 
+ * > '../css/digitize.css', 'url to the style sheet of the mapframe' ,
+ * > 'var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
+ * > var_value, context, var_type) VALUES('<appId>', 'digitize', 
+ * > 'digitize_conf_filename', 'digitize_default.conf', '' ,'php_var');
+ * >
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
+ * > var_value, context, var_type) VALUES('<appId>', 'digitize', 
+ * > 'text css', 
+ * > 'digitizeGeometryList {position:absolute; top:50px; left:0px;} .digitizeGeometryListItem {color:#000000; font-size:10px;} body {font-family: Arial, Helvetica, sans-serif; font-size:12px; color:#ff00ff; background-color:#ffffff; margin-top: 0px; margin-left:0px;} .button {height:18px; width:32px;}', 
+ * > 'text css' ,'text/css');
+ * > 
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, 
+ * > var_value, context, var_type) VALUES('<appId>', 'digitize', 
+ * > 'wfsCssUrl', '../css/mapbender.css', 'var' ,'var');
+ *
+ * Help:
+ * http://www.mapbender.org/Digitize
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ * 
+ * Parameters:
+ * cssUrl - path/filename of CSS which specifies the design of digitize 
+ * 			objects in the map do not change the default file, create your 
+ * 			own css file from the default file
+ * text css - CSS text for the geometry list
+ * wfsCssUrl - path/filename of CSS which specifies the design of the popup
+ * 			which appears when a feature is saved or updated
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License 
+ * and Simplified BSD license.  
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
+
 //
 // Buttons
 //
@@ -137,14 +194,80 @@
 		});
 	}
 	
+	/**
+	 * Property: events.closeGeometry
+	 * 
+	 * Description:
+	 * Your callback functions receive an object with the 
+	 * following attributes
+	 * - index: index of feature in current feature collection
+	 * - feature: the <Mapbender.MultiGeometry>
+	 */
 	parent.Mapbender.modules[mod_digitize_elName].events = {
+		/**
+		 * Property: events.closeGeometry
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired after a new geometry has been 
+		 * digitized. 
+		 */
 		closeGeometry: eventCloseGeometry,
+		/**
+		 * Property: events.beforeUpdateOrInsert
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired before a feature is updated
+		 * or inserted by WFS-T. 
+		 */
 		beforeUpdateOrInsert: new parent.Mapbender.Event(),
+		/**
+		 * Property: events.beforeUpdate
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired before a feature is updated
+		 * by WFS-T. 
+		 */
 		beforeUpdate: new parent.Mapbender.Event(),
+		/**
+		 * Property: events.beforeInsert
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired before a feature is inserted 
+		 * by WFS-T. 
+		 */
 		beforeInsert: new parent.Mapbender.Event(),
+		/**
+		 * Property: events.openDialog
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired before the user opens the dialog
+		 * for inserting or updating. Returning false in your callback prevents
+		 * the default dialog from popping up.
+		 */
 		openDialog: new parent.Mapbender.Event(),
+		/**
+		 * Property: events.clickDelete
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired when the user clicks the button to 
+		 * delete features by WFS-T
+		 */
 		clickDelete: new parent.Mapbender.Event(),
+		/**
+		 * Property: events.geometryInserted
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired after a feature has been inserted 
+		 * by WFS-T
+		 */
 		geometryInserted: new parent.Mapbender.Event(),
+		/**
+		 * Property: events.afterWfs
+		 * 
+		 * Description:
+		 * This <Mapbender.Event> is fired after a feature has been inserted,
+		 * updated or deleted by WFS-T
+		 */
 		afterWfs: new parent.Mapbender.Event()
 	};
 
@@ -2419,15 +2542,18 @@
 		if (type === "insert" || type === "update") {
 			var module = parent.Mapbender.modules[mod_digitize_elName]; 
 			module.events.beforeUpdateOrInsert.trigger({
+				geometryIndex: m,
 				feature: d.get(m)
 			});
 			if (type === "insert") {
 				module.events.beforeInsert.trigger({
+					geometryIndex: m,
 					feature: d.get(m)
 				});
 			}
 			if (type === "update") {
 				module.events.beforeUpdate.trigger({
+					geometryIndex: m,
 					feature: d.get(m)
 				});
 			}
@@ -2505,6 +2631,7 @@
 		else {
 			parent.Mapbender.modules[mod_digitize_elName].events.geometryInserted.trigger({
 				fid: fid,
+				geometryIndex: m,
 				feature: d.get(m)
 			});
 			new parent.Mb_notice(wfsWriteMessage);
@@ -2518,6 +2645,7 @@
 		else {
 			parent.Mapbender.modules[mod_digitize_elName].events.geometryInserted.trigger({
 				fid: fid,
+				geometryIndex: m,
 				feature: d.get(m)
 			});
 			new parent.Mb_notice(wfsWriteMessage);



More information about the Mapbender_commits mailing list