Transformed
This commit is contained in:
@@ -1,30 +1,28 @@
|
||||
|
||||
|
||||
goog.require('ol.reproj');
|
||||
goog.require('ol.proj');
|
||||
import _ol_reproj_ from '../../../../src/ol/reproj.js';
|
||||
import _ol_proj_ from '../../../../src/ol/proj.js';
|
||||
|
||||
|
||||
describe('ol.reproj', function() {
|
||||
|
||||
describe('#calculateSourceResolution', function() {
|
||||
var proj3857 = ol.proj.get('EPSG:3857');
|
||||
var proj4326 = ol.proj.get('EPSG:4326');
|
||||
var proj3857 = _ol_proj_.get('EPSG:3857');
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var origin = [0, 0];
|
||||
var point3857 = [50, 40];
|
||||
var point4326 = ol.proj.transform(point3857, proj3857, proj4326);
|
||||
var point4326 = _ol_proj_.transform(point3857, proj3857, proj4326);
|
||||
|
||||
it('is identity for identical projection', function() {
|
||||
var result;
|
||||
var resolution = 500;
|
||||
result = ol.reproj.calculateSourceResolution(
|
||||
result = _ol_reproj_.calculateSourceResolution(
|
||||
proj3857, proj3857, origin, resolution);
|
||||
expect(result).to.be(resolution);
|
||||
|
||||
result = ol.reproj.calculateSourceResolution(
|
||||
result = _ol_reproj_.calculateSourceResolution(
|
||||
proj3857, proj3857, point3857, resolution);
|
||||
expect(result).to.be(resolution);
|
||||
|
||||
result = ol.reproj.calculateSourceResolution(
|
||||
result = _ol_reproj_.calculateSourceResolution(
|
||||
proj4326, proj4326, point4326, resolution);
|
||||
expect(result).to.be(resolution);
|
||||
});
|
||||
@@ -32,13 +30,13 @@ describe('ol.reproj', function() {
|
||||
it('calculates correctly', function() {
|
||||
var resolution4326 = 5;
|
||||
|
||||
var resolution3857 = ol.reproj.calculateSourceResolution(
|
||||
var resolution3857 = _ol_reproj_.calculateSourceResolution(
|
||||
proj3857, proj4326, point4326, resolution4326);
|
||||
expect(resolution3857).not.to.be(resolution4326);
|
||||
expect(resolution3857).to.roughlyEqual(
|
||||
5 * proj4326.getMetersPerUnit(), 1e-4);
|
||||
|
||||
var result = ol.reproj.calculateSourceResolution(
|
||||
var result = _ol_reproj_.calculateSourceResolution(
|
||||
proj4326, proj3857, point3857, resolution3857);
|
||||
expect(result).to.be(resolution4326);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user