docs: function(geometryAttribute, geometry) {
          var filter = null;
          if (this.handler instanceof OpenLayers.Handler.RegularPolygon) {
              // box
              if (this.handler.irregular === true) {
                  filter = new OpenLayers.Filter.Spatial({
                      type: OpenLayers.Filter.Spatial.BBOX,
                      property: geometryAttribute.name,
                      value: geometry.getBounds()}
                  );
              } else {
                  filter = new OpenLayers.Filter.Spatial({
                      type: OpenLayers.Filter.Spatial.INTERSECTS,
                      property: geometryAttribute.name,
                      value: geometry}
                  );
              }
          } else if (this.handler instanceof OpenLayers.Handler.Polygon) {
              filter = new OpenLayers.Filter.Spatial({
                  type: OpenLayers.Filter.Spatial.INTERSECTS,
                  property: geometryAttribute.name,
                  value: geometry}
              );
          } else if (this.handler instanceof OpenLayers.Handler.Path) {
              // if source layer is point based, use DWITHIN instead
              if (geometryAttribute.type.indexOf('Point') >= 0) {
                  filter = new OpenLayers.Filter.Spatial({
                      type: OpenLayers.Filter.Spatial.DWITHIN,
                      property: geometryAttribute.name,
                      distance: this.map.getExtent().getWidth()*0.01 ,
                      distanceUnits: this.map.getUnits(),
                      value: geometry}
                  );
              } else {
                  filter = new OpenLayers.Filter.Spatial({
                      type: OpenLayers.Filter.Spatial.INTERSECTS,
                      property: geometryAttribute.name,
                      value: geometry}
                  );
              }
          } else if (this.handler instanceof OpenLayers.Handler.Click) {
              if (geometryAttribute.type.indexOf('Polygon') >= 0) {
                  filter = new OpenLayers.Filter.Spatial({
                      type: OpenLayers.Filter.Spatial.INTERSECTS,
                      property: geometryAttribute.name,
                      value: geometry}
                  );
              } else {
                  filter = new OpenLayers.Filter.Spatial({
                      type: OpenLayers.Filter.Spatial.DWITHIN,
                      property: geometryAttribute.name,
                      distance: this.map.getExtent().getWidth()*0.01 ,
                      distanceUnits: this.map.getUnits(),
                      value: geometry}
                  );
              }
          }
          return filter;
      }