Remove unused ol.extent.touches function
This commit is contained in:
@@ -808,19 +808,6 @@ ol.extent.intersectsSegment = function(extent, start, end) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {ol.Extent} extent1 Extent 1.
|
|
||||||
* @param {ol.Extent} extent2 Extent 2.
|
|
||||||
* @return {boolean} Touches.
|
|
||||||
*/
|
|
||||||
ol.extent.touches = function(extent1, extent2) {
|
|
||||||
var intersects = ol.extent.intersects(extent1, extent2);
|
|
||||||
return intersects &&
|
|
||||||
(extent1[0] == extent2[2] || extent1[2] == extent2[0] ||
|
|
||||||
extent1[1] == extent2[3] || extent1[3] == extent2[1]);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply a transform function to the extent.
|
* Apply a transform function to the extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
|
|||||||
@@ -602,23 +602,6 @@ describe('ol.extent', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('touches', function() {
|
|
||||||
|
|
||||||
it('returns the expected value', function() {
|
|
||||||
var touches = ol.extent.touches;
|
|
||||||
var extent = [50, 50, 100, 100];
|
|
||||||
expect(touches(extent, [20, 20, 80, 80])).to.be(false);
|
|
||||||
expect(touches(extent, [20, 20, 50, 80])).to.be(true);
|
|
||||||
expect(touches(extent, [20, 20, 50, 40])).to.be(false);
|
|
||||||
expect(touches(extent, [100, 20, 140, 80])).to.be(true);
|
|
||||||
expect(touches(extent, [100, 20, 140, 40])).to.be(false);
|
|
||||||
expect(touches(extent, [20, 20, 80, 50])).to.be(true);
|
|
||||||
expect(touches(extent, [20, 20, 40, 50])).to.be(false);
|
|
||||||
expect(touches(extent, [20, 100, 80, 140])).to.be(true);
|
|
||||||
expect(touches(extent, [20, 100, 40, 140])).to.be(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('scaleFromCenter', function() {
|
describe('scaleFromCenter', function() {
|
||||||
it('scales the extent from its center', function() {
|
it('scales the extent from its center', function() {
|
||||||
var extent = [1, 1, 3, 3];
|
var extent = [1, 1, 3, 3];
|
||||||
|
|||||||
Reference in New Issue
Block a user