Named exports from ol/source/WMTS
This commit is contained in:
@@ -2,7 +2,7 @@ import WMTSCapabilities from '../../../../src/ol/format/WMTSCapabilities.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import Projection from '../../../../src/ol/proj/Projection.js';
|
||||
import WMTSTileGrid from '../../../../src/ol/tilegrid/WMTS.js';
|
||||
import WMTS from '../../../../src/ol/source/WMTS.js';
|
||||
import WMTS, {optionsFromCapabilities} from '../../../../src/ol/source/WMTS.js';
|
||||
|
||||
|
||||
describe('ol.source.WMTS', function() {
|
||||
@@ -23,7 +23,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('returns null if the layer was not found in the capabilities', function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'invalid'
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('passes the crossOrigin option', function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
matrixSet: 'google3857',
|
||||
crossOrigin: ''
|
||||
@@ -42,7 +42,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can create KVP options from spec/ol/format/wmts/ogcsample.xml',
|
||||
function() {
|
||||
const options = WMTS.optionsFromCapabilities(
|
||||
const options = optionsFromCapabilities(
|
||||
capabilities,
|
||||
{layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857'});
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can create REST options from spec/ol/format/wmts/ogcsample.xml',
|
||||
function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
matrixSet: 'google3857',
|
||||
requestEncoding: 'REST'
|
||||
@@ -105,7 +105,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('can find a MatrixSet by SRS identifier', function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
projection: 'EPSG:3857',
|
||||
requestEncoding: 'REST'
|
||||
@@ -116,7 +116,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('can find a MatrixSet by equivalent SRS identifier', function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
projection: 'EPSG:900913',
|
||||
requestEncoding: 'REST'
|
||||
@@ -127,7 +127,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('can find the default MatrixSet', function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
requestEncoding: 'REST'
|
||||
});
|
||||
@@ -137,7 +137,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('uses the projection of the default MatrixSet if the config\'s projection is not supported', function() {
|
||||
const options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
const options = optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
projection: new Projection({
|
||||
code: 'EPSG:2056',
|
||||
@@ -153,7 +153,7 @@ describe('ol.source.WMTS', function() {
|
||||
const tmpXml = content.replace(/<ows:Constraint[\s\S]*?<\/ows:Constraint>/g, '');
|
||||
const tmpCapabilities = parser.read(tmpXml);
|
||||
expect(tmpCapabilities['OperationsMetadata']['GetTile']['DCP']['HTTP']['Get'][0]['Constraint']).to.be(undefined);
|
||||
const options = WMTS.optionsFromCapabilities(tmpCapabilities,
|
||||
const options = optionsFromCapabilities(tmpCapabilities,
|
||||
{layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857'});
|
||||
expect(options.layer).to.be.eql('BlueMarbleNextGeneration');
|
||||
expect(options.matrixSet).to.be.eql('google3857');
|
||||
@@ -166,7 +166,7 @@ describe('ol.source.WMTS', function() {
|
||||
const tmpCapabilities = parser.read(tmpXml);
|
||||
expect(tmpCapabilities['OperationsMetadata']['GetTile']['DCP']['HTTP']['Get'][0]['Constraint']).to.be(undefined);
|
||||
expect(tmpCapabilities['Contents']['Layer'][0]['ResourceURL']).to.be(undefined);
|
||||
const options = WMTS.optionsFromCapabilities(tmpCapabilities,
|
||||
const options = optionsFromCapabilities(tmpCapabilities,
|
||||
{layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857'});
|
||||
expect(options.layer).to.be.eql('BlueMarbleNextGeneration');
|
||||
expect(options.matrixSet).to.be.eql('google3857');
|
||||
@@ -247,7 +247,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can create KVP options from spec/ol/format/wmts/arcgis.xml',
|
||||
function() {
|
||||
const options = WMTS.optionsFromCapabilities(
|
||||
const options = optionsFromCapabilities(
|
||||
capabilities, {
|
||||
layer: 'Demographics_USA_Population_Density',
|
||||
requestEncoding: 'KVP',
|
||||
@@ -263,7 +263,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can create REST options from spec/ol/format/wmts/arcgis.xml',
|
||||
function() {
|
||||
const options = WMTS.optionsFromCapabilities(
|
||||
const options = optionsFromCapabilities(
|
||||
capabilities, {
|
||||
layer: 'Demographics_USA_Population_Density',
|
||||
matrixSet: 'default028mm'
|
||||
|
||||
Reference in New Issue
Block a user