[fusion-commits] r2420 - in trunk: layers/MapGuide lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Aug 9 21:09:04 EDT 2011


Author: liuar
Date: 2011-08-09 18:09:04 -0700 (Tue, 09 Aug 2011)
New Revision: 2420

Modified:
   trunk/layers/MapGuide/MapGuide.js
   trunk/lib/MGBroker.js
Log:
Fix ticket http://trac.osgeo.org/fusion/ticket/473
query() ignores the options.filter parameter

Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js	2011-08-09 06:22:51 UTC (rev 2419)
+++ trunk/layers/MapGuide/MapGuide.js	2011-08-10 01:09:04 UTC (rev 2420)
@@ -1024,12 +1024,17 @@
         {
             maxFeatures = -1;
         }
+        if(option.filter == null)
+        {
+            option.filter = '';
+        }
         var r = new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),
                                                                 this._sMapname,
                                                                 options.geometry,
                                                                 maxFeatures,
                                                                 persist,
                                                                 options.selectionType || this.selectionType,
+                                                                options.filter,
                                                                 options.layers,
                                                                 layerAttributeFilter);
         var callback = (options.extendSelection == true) ? OpenLayers.Function.bind(this.processAndMergeFeatureInfo, this) : OpenLayers.Function.bind(this.processFeatureInfo, this);
@@ -1109,6 +1114,7 @@
         var maxFeatures = 1;
         var persist = 0;
         var selection = 'INTERSECTS';
+        var filter = '';
         var layerNames = '';
         var layerAttributeFilter = 3;
         var sep = '';
@@ -1119,7 +1125,7 @@
         var r = new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),
                                                             this._sMapname,
                                                             sGeometry,
-                                                            maxFeatures, persist, selection, layerNames,
+                                                            maxFeatures, persist, selection, filter, layerNames,
                                                             layerAttributeFilter);
         var callback = OpenLayers.Function.bind(this.crtlClickDisplay, this);
         Fusion.oBroker.dispatchRequest(r, OpenLayers.Function.bind(Fusion.xml2json, this, callback));
@@ -1232,6 +1238,7 @@
         var maxFeatures = 1;
         var persist = 0;
         var selection = 'INTERSECTS';
+        var filter = '';
         // only select visible layers with maptips defined (1+4)
         var layerAttributeFilter = 5;
         //TODO: possibly make the layer names configurable?
@@ -1239,7 +1246,7 @@
         var r = new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),
                                         this._sMapname,
                                         sGeometry,
-                                        maxFeatures, persist, selection, layerNames,
+                                        maxFeatures, persist, selection, filter, layerNames,
                                         layerAttributeFilter);
         oBroker.dispatchRequest(r, 
             OpenLayers.Function.bind(Fusion.xml2json, this, 

Modified: trunk/lib/MGBroker.js
===================================================================
--- trunk/lib/MGBroker.js	2011-08-09 06:22:51 UTC (rev 2419)
+++ trunk/lib/MGBroker.js	2011-08-10 01:09:04 UTC (rev 2420)
@@ -567,13 +567,14 @@
      * @param maxFeatures {integer} number of maximum results (-1 to indicate no maximum)
      * @param selectionPersist {boolean} save the selection (valid values are 0 and 1) 
      * @param selectionVariant {String} indicates the spatial operation. Valid values are 'INTERSECTS', ...
+     * @param featureFilter {String} filter crieteria to be applied for selection.
      * @param layerNames {String} comma separated list of layer names to include in the query
      * @param layerAttributeFilter {integer} bitmask determining layer selection behaviour (1=visible layers,
      *          2=selectable layers, 4=layers with tooltips)
      *
      * @return {Object} an instance of Fusion.Lib.MGRequest.MGQueryMapFeatures
      */
-    initialize : function( sessionId, mapName, geometry, maxFeatures, persist, selectionVariant, layerNames, layerAttributeFilter ) 
+    initialize : function( sessionId, mapName, geometry, maxFeatures, persist, selectionVariant, featureFilter, layerNames, layerAttributeFilter ) 
     {
         this.initializeRequest();
         this.setParams( {
@@ -584,6 +585,7 @@
             maxFeatures: maxFeatures,
             persist: persist,
             selectionVariant: selectionVariant,
+            featureFilter: featureFilter,
             layerNames: layerNames,
             layerAttributeFilter: layerAttributeFilter
         } );



More information about the fusion-commits mailing list