Named exports from ol/proj
This commit is contained in:
committed by
Andreas Hocevar
parent
fab77e8d37
commit
6f72ffe498
@@ -1,13 +1,13 @@
|
||||
import _ol_Image_ from '../../../../src/ol/Image.js';
|
||||
import _ol_events_ from '../../../../src/ol/events.js';
|
||||
import _ol_proj_ from '../../../../src/ol/proj.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import _ol_reproj_Image_ from '../../../../src/ol/reproj/Image.js';
|
||||
|
||||
|
||||
describe('ol.reproj.Image', function() {
|
||||
function createImage(pixelRatio) {
|
||||
return new _ol_reproj_Image_(
|
||||
_ol_proj_.get('EPSG:3857'), _ol_proj_.get('EPSG:4326'),
|
||||
getProjection('EPSG:3857'), getProjection('EPSG:4326'),
|
||||
[-180, -85, 180, 85], 10, pixelRatio,
|
||||
function(extent, resolution, pixelRatio) {
|
||||
return new _ol_Image_(extent, resolution, pixelRatio,
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import _ol_reproj_ from '../../../../src/ol/reproj.js';
|
||||
import _ol_proj_ from '../../../../src/ol/proj.js';
|
||||
import {get as getProjection, transform} 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 = getProjection('EPSG:3857');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var origin = [0, 0];
|
||||
var point3857 = [50, 40];
|
||||
var point4326 = _ol_proj_.transform(point3857, proj3857, proj4326);
|
||||
var point4326 = transform(point3857, proj3857, proj4326);
|
||||
|
||||
it('is identity for identical projection', function() {
|
||||
var result;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ol_ImageTile_ from '../../../../src/ol/ImageTile.js';
|
||||
import _ol_events_ from '../../../../src/ol/events.js';
|
||||
import _ol_proj_ from '../../../../src/ol/proj.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import _ol_reproj_Tile_ from '../../../../src/ol/reproj/Tile.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('ol.reproj.Tile', function() {
|
||||
'+k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy ' +
|
||||
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
|
||||
'+units=m +no_defs');
|
||||
var proj27700 = _ol_proj_.get('EPSG:27700');
|
||||
var proj27700 = getProjection('EPSG:27700');
|
||||
proj27700.setExtent([0, 0, 700000, 1300000]);
|
||||
});
|
||||
|
||||
@@ -21,8 +21,8 @@ describe('ol.reproj.Tile', function() {
|
||||
|
||||
|
||||
function createTile(pixelRatio, opt_tileSize) {
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var proj3857 = _ol_proj_.get('EPSG:3857');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj3857 = getProjection('EPSG:3857');
|
||||
return new _ol_reproj_Tile_(
|
||||
proj3857, _ol_tilegrid_.createForProjection(proj3857), proj4326,
|
||||
_ol_tilegrid_.createForProjection(proj4326, 3, opt_tileSize),
|
||||
@@ -48,8 +48,8 @@ describe('ol.reproj.Tile', function() {
|
||||
});
|
||||
|
||||
it('is empty when outside target tile grid', function() {
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var proj3857 = _ol_proj_.get('EPSG:3857');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj3857 = getProjection('EPSG:3857');
|
||||
var tile = new _ol_reproj_Tile_(
|
||||
proj3857, _ol_tilegrid_.createForProjection(proj3857),
|
||||
proj4326, _ol_tilegrid_.createForProjection(proj4326),
|
||||
@@ -60,8 +60,8 @@ describe('ol.reproj.Tile', function() {
|
||||
});
|
||||
|
||||
it('is empty when outside source tile grid', function() {
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var proj27700 = _ol_proj_.get('EPSG:27700');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj27700 = getProjection('EPSG:27700');
|
||||
var tile = new _ol_reproj_Tile_(
|
||||
proj27700, _ol_tilegrid_.createForProjection(proj27700),
|
||||
proj4326, _ol_tilegrid_.createForProjection(proj4326),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_proj_ from '../../../../src/ol/proj.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import _ol_reproj_Triangulation_ from '../../../../src/ol/reproj/Triangulation.js';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ describe('ol.reproj.Triangulation', function() {
|
||||
'+k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy ' +
|
||||
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
|
||||
'+units=m +no_defs');
|
||||
var proj27700 = _ol_proj_.get('EPSG:27700');
|
||||
var proj27700 = getProjection('EPSG:27700');
|
||||
proj27700.setExtent([0, 0, 700000, 1300000]);
|
||||
});
|
||||
|
||||
@@ -18,22 +18,22 @@ describe('ol.reproj.Triangulation', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
it('is trivial for identity', function() {
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var triangulation = new _ol_reproj_Triangulation_(proj4326, proj4326,
|
||||
[20, 20, 30, 30], [-180, -90, 180, 90], 0);
|
||||
expect(triangulation.getTriangles().length).to.be(2);
|
||||
});
|
||||
|
||||
it('is empty when outside source extent', function() {
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var proj27700 = _ol_proj_.get('EPSG:27700');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj27700 = getProjection('EPSG:27700');
|
||||
var triangulation = new _ol_reproj_Triangulation_(proj27700, proj4326,
|
||||
[0, 0, 10, 10], proj27700.getExtent(), 0);
|
||||
expect(triangulation.getTriangles().length).to.be(0);
|
||||
});
|
||||
|
||||
it('can handle null source extent', function() {
|
||||
var proj4326 = _ol_proj_.get('EPSG:4326');
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var triangulation = new _ol_reproj_Triangulation_(proj4326, proj4326,
|
||||
[20, 20, 30, 30], null, 0);
|
||||
expect(triangulation.getTriangles().length).to.be(2);
|
||||
|
||||
Reference in New Issue
Block a user