Changeset 7946
- Timestamp:
- 09/04/08 06:57:44 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/camptocamp/unhcr/lib/OpenLayers/Lang/en.js
r7537 r7946 117 117 "OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.", 118 118 119 'end': '' 119 'end': '', 120 121 // console message 122 'evaluateNotImplemented': "evaluate is not implemented for this filter type" 120 123 }; sandbox/camptocamp/unhcr/lib/OpenLayers/Protocol/SQL.js
r7877 r7946 30 30 31 31 /** 32 * Property: postReadFiltering 33 * {Boolean} Whether the filter (if there's one) must be applied after 34 * the features have been read from the database; for example the 35 * BBOX strategy passes the read method a BBOX spatial filter, if 36 * postReadFiltering is true every feature read from the database 37 * will go through the BBOX spatial filter, which can be costly; 38 * defaults to true. 39 */ 40 postReadFiltering: true, 41 42 /** 32 43 * Constructor: OpenLayers.Protocol.SQL 33 44 */ … … 55 66 }, 56 67 68 /** 69 * Method: evaluateFilter 70 * If postReadFiltering is true evaluate the filter against the feature 71 * and return the result of the evaluation, otherwise return true. 72 * 73 * Parameters: 74 * {<OpenLayers.Feature.Vector>} The feature. 75 * {<OpenLayers.Filter>} The filter. 76 * 77 * Returns: 78 * {Boolean} true if postReadFiltering if false, the result of the 79 * filter evaluation otherwise. 80 */ 81 evaluateFilter: function(feature, filter) { 82 return filter && this.postReadFiltering ? 83 filter.evaluate(feature) : true; 84 }, 85 57 86 CLASS_NAME: "OpenLayers.Protocol.SQL" 58 87 }); 59 60 61 /**62 * APIFunction: factory.63 * Alternative constructor64 */65 OpenLayers.Protocol.SQL.factory = function(options) {66 // Available SQL backends.67 var sqls = ["Gears"];68 69 for (var i = 0; i < sqls.length; i++) {70 var sql = OpenLayers.Protocol.SQL[sqls[i]];71 if (sql && sql.prototype.supported()) {72 return new sql(options);73 }74 OpenLayers.Console.userError("No SQL backend supported ...");75 }76 }sandbox/camptocamp/unhcr/lib/OpenLayers/Protocol/SQL/Gears.js
r7918 r7946 161 161 while (rs.isValidRow()) { 162 162 feature = this.unfreezeFeature(rs); 163 if (!options.noFeatureStateReset) { 164 feature.state = null; 163 if (this.evaluateFilter(feature, options.filter)) { 164 if (!options.noFeatureStateReset) { 165 feature.state = null; 166 } 167 features.push(feature); 165 168 } 166 features.push(feature);167 169 rs.next(); 168 170 }
