Dedicated module for ol.proj.Projection
This commit is contained in:
@@ -49,7 +49,7 @@ describe('ol.proj.EPSG3857', function() {
|
||||
var epsg3857 = ol.proj.get('EPSG:3857');
|
||||
var resolution = 19.11;
|
||||
var point = [0, 0];
|
||||
expect(epsg3857.getPointResolution(resolution, point)).
|
||||
expect(ol.proj.getPointResolution(epsg3857, resolution, point)).
|
||||
to.roughlyEqual(19.11, 1e-1);
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ describe('ol.proj.EPSG3857', function() {
|
||||
var epsg4326 = ol.proj.get('EPSG:4326');
|
||||
var resolution = 19.11;
|
||||
var point = ol.proj.transform([0, 43.65], epsg4326, epsg3857);
|
||||
expect(epsg3857.getPointResolution(resolution, point)).
|
||||
expect(ol.proj.getPointResolution(epsg3857, resolution, point)).
|
||||
to.roughlyEqual(19.11 * Math.cos(Math.PI * 43.65 / 180), 1e-9);
|
||||
});
|
||||
|
||||
@@ -72,7 +72,7 @@ describe('ol.proj.EPSG3857', function() {
|
||||
var latitude;
|
||||
for (latitude = 0; latitude <= 85; ++latitude) {
|
||||
var point = ol.proj.transform([0, latitude], epsg4326, epsg3857);
|
||||
expect(epsg3857.getPointResolution(resolution, point)).
|
||||
expect(ol.proj.getPointResolution(epsg3857, resolution, point)).
|
||||
to.roughlyEqual(19.11 * Math.cos(Math.PI * latitude / 180), 1e-9);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user