Filter strategy constructor should not need filter, r=tschaub,fredj (closes #2841)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10879 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -45,14 +45,10 @@ OpenLayers.Strategy.Filter = OpenLayers.Class(OpenLayers.Strategy, {
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object} Optional object whose properties will be set on the
|
||||
* instance. Strategy must be constructed with at least a <filter>
|
||||
* property.
|
||||
* instance.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Strategy.prototype.initialize.apply(this, [options]);
|
||||
if (!this.filter || !(this.filter instanceof OpenLayers.Filter)) {
|
||||
throw new Error("Filter strategy must be constructed with a filter");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -102,7 +98,7 @@ OpenLayers.Strategy.Filter = OpenLayers.Class(OpenLayers.Strategy, {
|
||||
* Method: handleAdd
|
||||
*/
|
||||
handleAdd: function(event) {
|
||||
if (!this.caching) {
|
||||
if (!this.caching && this.filter) {
|
||||
var features = event.features;
|
||||
event.features = [];
|
||||
var feature;
|
||||
|
||||
Reference in New Issue
Block a user