Port ol.filter.ExtentFilter to new extents
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
goog.provide('ol.filter.Extent');
|
goog.provide('ol.filter.Extent');
|
||||||
|
|
||||||
goog.require('ol.Extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.filter.Filter');
|
goog.require('ol.filter.Filter');
|
||||||
|
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ ol.filter.Extent.prototype.getExtent = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.filter.Extent.prototype.applies = function(feature) {
|
ol.filter.Extent.prototype.applies = function(feature) {
|
||||||
return feature.getGeometry().getBounds().intersects(this.extent_);
|
return ol.extent.intersects(feature.getGeometry().getBounds(), this.extent_);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ describe('ol.filter.Extent', function() {
|
|||||||
var extent, filter;
|
var extent, filter;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
extent = new ol.Extent(0, 0, 45, 90);
|
extent = [0, 45, 0, 90];
|
||||||
filter = new ol.filter.Extent(extent);
|
filter = new ol.filter.Extent(extent);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -31,7 +31,6 @@ describe('ol.filter.Extent', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.filter.Extent');
|
goog.require('ol.filter.Extent');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ describe('ol.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var geomFilter = new ol.filter.Geometry(ol.geom.GeometryType.LINESTRING);
|
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));
|
var extentFilter = new ol.filter.Extent([16, 16.3, 48, 48.3]);
|
||||||
|
|
||||||
it('can filter by geometry type using its GeometryType index', function() {
|
it('can filter by geometry type using its GeometryType index', function() {
|
||||||
sinon.spy(geomFilter, 'applies');
|
sinon.spy(geomFilter, 'applies');
|
||||||
@@ -177,7 +177,6 @@ describe('ol.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
goog.require('ol.Expression');
|
goog.require('ol.Expression');
|
||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.filter.Extent');
|
goog.require('ol.filter.Extent');
|
||||||
goog.require('ol.filter.Geometry');
|
goog.require('ol.filter.Geometry');
|
||||||
|
|||||||
Reference in New Issue
Block a user