Function for getting great circle lengths

This commit is contained in:
Tim Schaub
2017-08-10 17:45:22 -06:00
parent 445c157ee3
commit 92c62e5432
5 changed files with 212 additions and 18 deletions
+6 -6
View File
@@ -221,21 +221,21 @@ describe('ol.proj', function() {
});
it('returns the correct point resolution for EPSG:4326 with custom units', function() {
var pointResolution = ol.proj.getPointResolution('EPSG:4326', 1, [0, 0], 'm');
expect (pointResolution).to.roughlyEqual(111194.874284, 1e-5);
expect(pointResolution).to.roughlyEqual(111195.0802335329, 1e-5);
pointResolution = ol.proj.getPointResolution('EPSG:4326', 1, [0, 52], 'm');
expect (pointResolution).to.roughlyEqual(89826.367538, 1e-5);
expect(pointResolution).to.roughlyEqual(89826.53390979706, 1e-5);
});
it('returns the correct point resolution for EPSG:3857', function() {
var pointResolution = ol.proj.getPointResolution('EPSG:3857', 1, [0, 0]);
expect (pointResolution).to.be(1);
expect(pointResolution).to.be(1);
pointResolution = ol.proj.getPointResolution('EPSG:3857', 1, ol.proj.fromLonLat([0, 52]));
expect (pointResolution).to.roughlyEqual(0.615661, 1e-5);
expect(pointResolution).to.roughlyEqual(0.615661, 1e-5);
});
it('returns the correct point resolution for EPSG:3857 with custom units', function() {
var pointResolution = ol.proj.getPointResolution('EPSG:3857', 1, [0, 0], 'degrees');
expect (pointResolution).to.be(1);
expect(pointResolution).to.be(1);
pointResolution = ol.proj.getPointResolution('EPSG:4326', 1, ol.proj.fromLonLat([0, 52]), 'degrees');
expect (pointResolution).to.be(1);
expect(pointResolution).to.be(1);
});
});