[Commits] r2681 - sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/OpenLayers/Control

commits at geoext.org commits at geoext.org
Thu May 12 20:23:07 CEST 2011


Author: adube
Date: 2011-05-12 20:23:07 +0200 (Thu, 12 May 2011)
New Revision: 2681

Modified:
   sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/OpenLayers/Control/UserFilter.js
Log:
WFSTFeatureEditing - UserFilter api documentation

Modified: sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/OpenLayers/Control/UserFilter.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/OpenLayers/Control/UserFilter.js	2011-05-12 18:07:30 UTC (rev 2680)
+++ sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/OpenLayers/Control/UserFilter.js	2011-05-12 18:23:07 UTC (rev 2681)
@@ -1,3 +1,23 @@
+/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for 
+ * full list of contributors). Published under the Clear BSD license.  
+ * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Control/GetFeature.js
+ * @requires OpenLayers/Layer/Vector.js
+ * @requires OpenLayers/Protocol/WFS/v1_0_0.js
+ * @requires OpenLayers/Protocol/WFS/v1_1_0.js
+ */
+
+/**
+ * Class: OpenLayers.Control.UserFilter
+ * Applies a spacial filter using a dragged box to the WFS protocol of a vector
+ *     layer.
+ *
+ * Inherits from:
+ *  - <OpenLayers.Control.GetFeature>
+ */
 OpenLayers.Control.UserFilter = OpenLayers.Class(OpenLayers.Control.GetFeature, {
     /**
      * Constant: EVENT_TYPES
@@ -10,17 +30,46 @@
 
     /* Public properties */
 
+    /**
+     * APIProperty: layer
+     * {<OpenLayers.Layer.Vector>} The layer containing the
+     *                             OpenLayers.Protocol.WFS to apply the filter.
+     */
     layer: null,
 
+    /**
+     * APIProperty: autoRefresh
+     * {Boolean} Whether to automatically refresh the layer when a filter is
+     *           applied or not.  Defaults to true.
+     */
     autoRefresh: true,
 
+    /**
+     * APIProperty: autoVisibility
+     * {Boolean} Whether to automatically show the layer when a a filter is
+     *           applied or not.  Defaults to true.
+     */
     autoVisibility: true,
 
     /* Private properties */
 
+    /**
+     * Property: hasBlankFilter
+     * {Boolean} Whether the current protocol filter is blank or not.
+     */
     hasBlankFilter: false,
 
-    /* methods */
+    /**
+     * Constructor: OpenLayers.Control.UserFilter
+     * Create a new userfilter control
+     *
+     * Parameters:
+     * options - {Object} Optional object with non-default properties to set on
+     *           the control.
+     *
+     * Returns:
+     * {<OpenLayers.Control.UserFilter>} A new userfilter control
+     */
     initialize: function(options) {
         this.EVENT_TYPES =
             OpenLayers.Control.UserFilter.prototype.EVENT_TYPES.concat(
@@ -71,34 +120,64 @@
         this.autoVisibility && this.layer.setVisibility(true);
     },
 
+    /**
+     * Method: activateHandlers
+     * Activate all the handlers of this control.
+     */
     activateHandlers: function() {
         for(var key in this.handlers) {
             this.handlers[key].activate();
         }
     },
 
+    /**
+     * Method: deactivateHandlers
+     * Deactivate all the handlers of this control.
+     */
     deactivateHandlers: function() {
         for(var key in this.handlers) {
             this.handlers[key].deactivate();
         }
     },
 
+    /**
+     * Method: setMap
+     * Set the map property for the control and apply a blank filter.
+     * 
+     * Parameters:
+     * map - {<OpenLayers.Map>} 
+     */
     setMap: function(map) {
         OpenLayers.Control.GetFeature.prototype.setMap.apply(this, arguments);
         this.applyBlankFilter();
     },
 
+    /**
+     * Method: activate
+     * Activates the control and apply a blank filter.
+     */
     activate: function() {
         OpenLayers.Control.GetFeature.prototype.activate.apply(this, arguments);
         this.applyBlankFilter();
     },
 
+    /**
+     * Method: deactivate
+     * Deactivates the control and apply a blank filter.
+     */
     deactivate: function() {
         OpenLayers.Control.GetFeature.prototype.deactivate.apply(
             this, arguments);
         this.applyBlankFilter();
     },
 
+    /**
+     * Method: applyBlankFilter
+     * Apply a blank spatial filter to the layer protocol.
+     *
+     * Parameters:
+     * options - {Object} Hash of options 
+     */
     applyBlankFilter: function(options) {
         options = options || {};
         if (options.force === true || this.hasBlankFilter === false) {



More information about the Commits mailing list