Named exports from ol/proj
This commit is contained in:
committed by
Andreas Hocevar
parent
fab77e8d37
commit
6f72ffe498
@@ -1,6 +1,6 @@
|
||||
import _ol_ImageTile_ from '../../../../src/ol/ImageTile.js';
|
||||
import _ol_source_TileArcGISRest_ from '../../../../src/ol/source/TileArcGISRest.js';
|
||||
import _ol_proj_ from '../../../../src/ol/proj.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
|
||||
|
||||
describe('ol.source.TileArcGISRest', function() {
|
||||
@@ -17,7 +17,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
|
||||
it('returns a tile with the expected URL', function() {
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
var tile = source.getTile(3, 2, -7, 1, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
expect(tile).to.be.an(_ol_ImageTile_);
|
||||
var uri = new URL(tile.src_);
|
||||
expect(uri.protocol).to.be('http:');
|
||||
@@ -39,7 +39,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
|
||||
it('returns a non floating point DPI value', function() {
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
var tile = source.getTile(3, 2, -7, 1.12, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1.12, getProjection('EPSG:3857'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
expect(queryData.get('DPI')).to.be('101');
|
||||
@@ -48,7 +48,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
it('takes DPI from params if specified', function() {
|
||||
options.params.DPI = 96;
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
var tile = source.getTile(3, 2, -7, 1.12, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1.12, getProjection('EPSG:3857'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
expect(queryData.get('DPI')).to.be('108');
|
||||
@@ -60,7 +60,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
options.urls = ['http://test1.com/MapServer', 'http://test2.com/MapServer'];
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
|
||||
var tile = source.getTile(3, 2, -7, 1, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
expect(tile).to.be.an(_ol_ImageTile_);
|
||||
var uri = new URL(tile.src_);
|
||||
expect(uri.protocol).to.be('http:');
|
||||
@@ -83,7 +83,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
it('returns a tile with the expected URL for ImageServer', function() {
|
||||
options.url = 'http://example.com/ImageServer';
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
var tile = source.getTile(3, 2, -7, 1, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
expect(tile).to.be.an(_ol_ImageTile_);
|
||||
var uri = new URL(tile.src_);
|
||||
expect(uri.protocol).to.be('http:');
|
||||
@@ -106,7 +106,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
options.params.FORMAT = 'png';
|
||||
options.params.TRANSPARENT = false;
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, _ol_proj_.get('EPSG:4326'));
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
expect(queryData.get('FORMAT')).to.be('png');
|
||||
@@ -116,7 +116,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
it('allows adding rest option', function() {
|
||||
options.params.LAYERS = 'show:1,3,4';
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
var tile = source.getTile(3, 2, -3, 1, _ol_proj_.get('EPSG:4326'));
|
||||
var tile = source.getTile(3, 2, -3, 1, getProjection('EPSG:4326'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
expect(queryData.get('LAYERS')).to.be('show:1,3,4');
|
||||
@@ -129,7 +129,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
source.updateParams({'TEST': 'value'});
|
||||
|
||||
var tile = source.getTile(3, 2, -7, 1, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
expect(queryData.get('TEST')).to.be('value');
|
||||
@@ -141,7 +141,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
var source = new _ol_source_TileArcGISRest_(options);
|
||||
source.updateParams({'TEST': 'newValue'});
|
||||
|
||||
var tile = source.getTile(3, 2, -7, 1, _ol_proj_.get('EPSG:3857'));
|
||||
var tile = source.getTile(3, 2, -7, 1, getProjection('EPSG:3857'));
|
||||
var uri = new URL(tile.src_);
|
||||
var queryData = uri.searchParams;
|
||||
expect(queryData.get('TEST')).to.be('newValue');
|
||||
@@ -245,7 +245,7 @@ describe('ol.source.TileArcGISRest', function() {
|
||||
|
||||
expect(urls).to.eql(['http://test3.com/MapServer']);
|
||||
|
||||
var tileUrl = source.tileUrlFunction([0, 0, 0], 1, _ol_proj_.get('EPSG:4326'));
|
||||
var tileUrl = source.tileUrlFunction([0, 0, 0], 1, getProjection('EPSG:4326'));
|
||||
expect(tileUrl.indexOf(urls[0])).to.be(0);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user