Named exports from ol/proj

This commit is contained in:
Tim Schaub
2017-12-13 22:14:27 -07:00
committed by Andreas Hocevar
parent fab77e8d37
commit 6f72ffe498
127 changed files with 853 additions and 882 deletions

View File

@@ -2,7 +2,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_layer_Image_ from '../../../../src/ol/layer/Image.js';
import _ol_obj_ from '../../../../src/ol/obj.js';
import _ol_proj_ from '../../../../src/ol/proj.js';
import {get as getProjection, transform, transformExtent} from '../../../../src/ol/proj.js';
import _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -17,7 +17,7 @@ describe('ol.rendering.layer.Image', function() {
target: createMapDiv(50, 50),
renderer: renderer,
view: new _ol_View_({
center: _ol_proj_.transform(
center: transform(
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
zoom: 5
})
@@ -69,7 +69,7 @@ describe('ol.rendering.layer.Image', function() {
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
imageExtent: _ol_tilegrid_.createXYZ().getTileCoordExtent(
[5, 5, -12 - 1]),
projection: _ol_proj_.get('EPSG:3857')
projection: getProjection('EPSG:3857')
});
});
@@ -97,7 +97,7 @@ describe('ol.rendering.layer.Image', function() {
beforeEach(function() {
source = new _ol_source_ImageStatic_({
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
imageExtent: _ol_proj_.transformExtent(
imageExtent: transformExtent(
[-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857')
});
});

View File

@@ -4,7 +4,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../../../../src/ol/layer/Tile.js';
import _ol_obj_ from '../../../../src/ol/obj.js';
import _ol_proj_ from '../../../../src/ol/proj.js';
import {transform} from '../../../../src/ol/proj.js';
import _ol_source_TileImage_ from '../../../../src/ol/source/TileImage.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
@@ -25,7 +25,7 @@ describe('ol.rendering.layer.Tile', function() {
target: createMapDiv(size[0], size[1]),
renderer: renderer,
view: new _ol_View_({
center: opt_center !== undefined ? opt_center : _ol_proj_.transform(
center: opt_center !== undefined ? opt_center : transform(
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
resolutions: opt_resolutions,
zoom: 5
@@ -285,7 +285,7 @@ describe('ol.rendering.layer.Tile', function() {
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
}));
e.vectorContext.drawPoint(new _ol_geom_Point_(
_ol_proj_.transform([-123, 38], 'EPSG:4326', 'EPSG:3857')));
transform([-123, 38], 'EPSG:4326', 'EPSG:3857')));
});
};
});

View File

@@ -1,5 +1,5 @@
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_proj_EPSG3857_ from '../../../../src/ol/proj/EPSG3857.js';
import _ol_reproj_Image_ from '../../../../src/ol/reproj/Image.js';
import _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js';
@@ -14,7 +14,7 @@ describe('ol.rendering.reproj.Image', function() {
var imagesRequested = 0;
var image = new _ol_reproj_Image_(sourceProj, _ol_proj_.get(targetProj),
var image = new _ol_reproj_Image_(sourceProj, getProjection(targetProj),
targetExtent, targetResolution, pixelRatio,
function(extent, resolution, pixelRatio) {
imagesRequested++;
@@ -38,7 +38,7 @@ describe('ol.rendering.reproj.Image', function() {
source = new _ol_source_ImageStatic_({
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
imageExtent: _ol_tilegrid_.createXYZ().getTileCoordExtent([5, 5, -13]),
projection: _ol_proj_.get('EPSG:3857')
projection: getProjection('EPSG:3857')
});
});

View File

@@ -1,6 +1,6 @@
import _ol_TileState_ from '../../../../src/ol/TileState.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_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -16,7 +16,7 @@ describe('ol.rendering.reproj.Tile', function() {
var tilesRequested = 0;
var tile = new _ol_reproj_Tile_(sourceProjection, source.getTileGrid(),
_ol_proj_.get(targetProjection), targetTileGrid,
getProjection(targetProjection), targetTileGrid,
[z, x, y], null, pixelRatio, sourceGutter,
function(z, x, y, pixelRatio) {
tilesRequested++;
@@ -58,7 +58,7 @@ describe('ol.rendering.reproj.Tile', function() {
proj4.defs('EPSG:5070',
'+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 ' +
'+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
var proj5070 = _ol_proj_.get('EPSG:5070');
var proj5070 = getProjection('EPSG:5070');
proj5070.setExtent([-6e6, 0, 4e6, 6e6]);
var tileGrid = _ol_tilegrid_.createForProjection('EPSG:5070', 5, [64, 64]);
@@ -69,7 +69,7 @@ describe('ol.rendering.reproj.Tile', function() {
it('to ESRI:54009', function(done) {
proj4.defs('ESRI:54009',
'+proj=moll +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
var proj54009 = _ol_proj_.get('ESRI:54009');
var proj54009 = getProjection('ESRI:54009');
proj54009.setExtent([-18e6, -9e6, 18e6, 9e6]);
var tileGrid = _ol_tilegrid_.createForProjection('ESRI:54009', 7, [64, 64]);
@@ -96,7 +96,7 @@ describe('ol.rendering.reproj.Tile', function() {
proj4.defs('EPSG:3740',
'+proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 ' +
'+units=m +no_defs');
var proj3740 = _ol_proj_.get('EPSG:3740');
var proj3740 = getProjection('EPSG:3740');
proj3740.setExtent([318499.05, 2700792.39, 4359164.89, 7149336.98]);
var tileGrid = _ol_tilegrid_.createForProjection('EPSG:3740', 4, [64, 64]);
@@ -158,7 +158,7 @@ describe('ol.rendering.reproj.Tile', function() {
it('wraps X when prime meridian is shifted', function(done) {
proj4.defs('merc_180', '+proj=merc +lon_0=180 +units=m +no_defs');
var proj_ = _ol_proj_.get('merc_180');
var proj_ = getProjection('merc_180');
proj_.setExtent([-20026376.39, -20048966.10, 20026376.39, 20048966.10]);
var tileGrid = _ol_tilegrid_.createForProjection('merc_180', 0, [64, 64]);
@@ -169,7 +169,7 @@ describe('ol.rendering.reproj.Tile', function() {
it('displays north pole correctly (EPSG:3413)', function(done) {
proj4.defs('EPSG:3413', '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 ' +
'+k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
var proj3413 = _ol_proj_.get('EPSG:3413');
var proj3413 = getProjection('EPSG:3413');
proj3413.setExtent([-4194304, -4194304, 4194304, 4194304]);
var tileGrid = _ol_tilegrid_.createForProjection('EPSG:3413', 0, [64, 64]);