Skip to content

Commit

Permalink
fix extent._project, close #899
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed May 27, 2019
1 parent d100f78 commit dd45db9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/geo/Extent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
6 changes: 6 additions & 0 deletions test/geometry/ExtentSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});


Expand Down

0 comments on commit dd45db9

Please sign in to comment.