Skip to content
Browse files

Making the linter happy

  • Loading branch information...
1 parent 8c03abd commit 59fe714fa6b646e797a3274c2ab08130bcc7b3f3 @ahocevar ahocevar committed Feb 15, 2013
Showing with 9 additions and 6 deletions.
  1. +1 −0 src/ol/source/vectorsource.js
  2. +8 −6 test/spec/ol/source/vectorsource.test.js
View
1 src/ol/source/vectorsource.js
@@ -8,6 +8,7 @@ goog.require('ol.filter.Extent');
goog.require('ol.filter.Filter');
goog.require('ol.filter.Geometry');
goog.require('ol.filter.Logical');
+goog.require('ol.filter.LogicalOperator');
goog.require('ol.geom.GeometryType');
goog.require('ol.source.TileSource');
goog.require('ol.structs.RTree');
View
14 test/spec/ol/source/vectorsource.test.js
@@ -2,7 +2,7 @@ goog.provide('ol.test.source.Vector');
describe('ol.source.Vector', function() {
-
+
var vectorSource, features;
beforeEach(function() {
@@ -29,7 +29,7 @@ describe('ol.source.Vector', function() {
vectorSource.addFeatures([new ol.Feature()]);
expect(vectorSource.getFeatures().length).toEqual(features.length + 1);
});
-
+
var geomFilter = new ol.filter.Geometry(ol.geom.GeometryType.LINESTRING);
var extentFilter = new ol.filter.Extent(new ol.Extent(16, 48, 16.3, 48.3));
@@ -40,15 +40,15 @@ describe('ol.source.Vector', function() {
expect(lineStrings.length).toEqual(4);
expect(lineStrings).toContain(features[4]);
});
-
+
it('can filter by extent using its RTree', function() {
spyOn(extentFilter, 'evaluate');
var subset = vectorSource.getFeatures(extentFilter);
expect(extentFilter.evaluate).not.toHaveBeenCalled();
expect(subset.length).toEqual(4);
expect(subset).not.toContain(features[7]);
});
-
+
it('can filter by extent and geometry type using its index', function() {
var filter1 = new ol.filter.Logical([geomFilter, extentFilter],
ol.filter.LogicalOperator.AND);
@@ -63,7 +63,7 @@ describe('ol.source.Vector', function() {
expect(subset1.length).toEqual(0);
expect(subset2.length).toEqual(0);
});
-
+
it('can handle any query using the filter\'s evaluate function', function() {
var filter = new ol.filter.Logical([geomFilter, extentFilter],
ol.filter.LogicalOperator.OR);
@@ -76,7 +76,9 @@ describe('ol.source.Vector', function() {
});
goog.require('ol.Projection');
-goog.require('ol.filter.GeometryType');
+goog.require('ol.filter.Geometry');
+goog.require('ol.filter.Logical');
+goog.require('ol.filter.LogicalOperator');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.Point');
goog.require('ol.geom.LineString');

0 comments on commit 59fe714

Please sign in to comment.
Something went wrong with that request. Please try again.