More tests and docs for extent and coordinate wrapX
This commit is contained in:
@@ -407,7 +407,8 @@ export function toStringXY(coordinate, opt_fractionDigits) {
|
||||
|
||||
/**
|
||||
* Modifies the provided coordinate in-place to be within the real world
|
||||
* extent.
|
||||
* extent. The lower projection extent boundary is inclusive, the upper one
|
||||
* exclusive.
|
||||
*
|
||||
* @param {Coordinate} coordinate Coordinate.
|
||||
* @param {import("./proj/Projection.js").default} projection Projection
|
||||
|
||||
@@ -849,6 +849,12 @@ describe('ol.extent', function() {
|
||||
expect(_ol_extent_.wrapX([300, 48, 376, 49], projection)).to.eql([-60, 48, 16, 49]);
|
||||
});
|
||||
|
||||
it('produces the same real world extent for shifted extents with center at +/-180', function() {
|
||||
expect(_ol_extent_.wrapX([360, -90, 720, 90], projection)).to.eql([-360, -90, 0, 90]);
|
||||
expect(_ol_extent_.wrapX([0, -90, 360, 90], projection)).to.eql([-360, -90, 0, 90]);
|
||||
expect(_ol_extent_.wrapX([-360, -90, 0, 90], projection)).to.eql([-360, -90, 0, 90]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('approximatelyEquals', function() {
|
||||
|
||||
Reference in New Issue
Block a user