diff --git a/src/geo/Extent.js b/src/geo/Extent.js index 031f3943a..1c0a97274 100644 --- a/src/geo/Extent.js +++ b/src/geo/Extent.js @@ -547,7 +547,7 @@ class Extent { //FIXME a rare but potential bug: //An extent may be projected by multiple projection if (ext._dirty) { - let minmax = [ext.getMin(), ext.getMax()]; + let minmax = [new Coordinate(ext.xmax, ext.ymin), new Coordinate(ext.xmin, ext.ymax)]; minmax = proj.projectCoords(minmax); const min = minmax[0], max = minmax[1]; diff --git a/test/geometry/ExtentSpec.js b/test/geometry/ExtentSpec.js index 49c5a5c5e..af151b8ac 100644 --- a/test/geometry/ExtentSpec.js +++ b/test/geometry/ExtentSpec.js @@ -197,6 +197,12 @@ describe('ExtentSpec', function () { expect(ext1.contains(new maptalks.Point(20, 20))).to.not.be.ok(); }); + //#899 + it('contains with projection', function () { + var ext = new maptalks.Extent([-170, -80, 170, 80], maptalks.projection.EPSG3857); + + expect(ext.contains(new maptalks.Coordinate([-0.113049,51.49856]))).to.be.ok(); + }); });