Rename _ol_source_WMTS_ to WMTS
This commit is contained in:
@@ -2,7 +2,7 @@ import _ol_format_WMTSCapabilities_ from '../../../../src/ol/format/WMTSCapabili
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
|
||||
import WMTSTileGrid from '../../../../src/ol/tilegrid/WMTS.js';
|
||||
import _ol_source_WMTS_ from '../../../../src/ol/source/WMTS.js';
|
||||
import WMTS 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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
layer: 'invalid'
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('passes the crossOrigin option', function() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(capabilities, {
|
||||
var options = WMTS.optionsFromCapabilities(capabilities, {
|
||||
layer: 'BlueMarbleNextGeneration',
|
||||
projection: new _ol_proj_Projection_({
|
||||
code: 'EPSG:2056',
|
||||
@@ -153,7 +153,7 @@ describe('ol.source.WMTS', function() {
|
||||
var tmpXml = content.replace(/<ows:Constraint[\s\S]*?<\/ows:Constraint>/g, '');
|
||||
var tmpCapabilities = parser.read(tmpXml);
|
||||
expect(tmpCapabilities['OperationsMetadata']['GetTile']['DCP']['HTTP']['Get'][0]['Constraint']).to.be(undefined);
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(tmpCapabilities,
|
||||
var options = WMTS.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() {
|
||||
var 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);
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(tmpCapabilities,
|
||||
var options = WMTS.optionsFromCapabilities(tmpCapabilities,
|
||||
{layer: 'BlueMarbleNextGeneration', matrixSet: 'google3857'});
|
||||
expect(options.layer).to.be.eql('BlueMarbleNextGeneration');
|
||||
expect(options.matrixSet).to.be.eql('google3857');
|
||||
@@ -180,7 +180,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can replace lowercase REST parameters',
|
||||
function() {
|
||||
var source = new _ol_source_WMTS_({
|
||||
var source = new WMTS({
|
||||
layer: 'layer',
|
||||
style: 'default',
|
||||
urls: ['http://www.example.com/wmts/coastlines/{layer}/{style}/' +
|
||||
@@ -206,7 +206,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can replace camelcase REST parameters',
|
||||
function() {
|
||||
var source = new _ol_source_WMTS_({
|
||||
var source = new WMTS({
|
||||
layer: 'layer',
|
||||
style: 'default',
|
||||
urls: ['http://www.example.com/wmts/coastlines/{Layer}/{Style}/' +
|
||||
@@ -247,7 +247,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('can create KVP options from spec/ol/format/wmts/arcgis.xml',
|
||||
function() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(
|
||||
var options = WMTS.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() {
|
||||
var options = _ol_source_WMTS_.optionsFromCapabilities(
|
||||
var options = WMTS.optionsFromCapabilities(
|
||||
capabilities, {
|
||||
layer: 'Demographics_USA_Population_Density',
|
||||
matrixSet: 'default028mm'
|
||||
@@ -281,7 +281,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
describe('#setUrls()', function() {
|
||||
it('sets the URL for the source', function() {
|
||||
var source = new _ol_source_WMTS_({});
|
||||
var source = new WMTS({});
|
||||
|
||||
var urls = [
|
||||
'https://a.example.com/',
|
||||
@@ -294,7 +294,7 @@ describe('ol.source.WMTS', function() {
|
||||
});
|
||||
|
||||
it('updates the key for the source', function() {
|
||||
var source = new _ol_source_WMTS_({});
|
||||
var source = new WMTS({});
|
||||
|
||||
var urls = [
|
||||
'https://a.example.com/',
|
||||
@@ -308,7 +308,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
it('generates the correct tileUrlFunction during application of setUrl()', function() {
|
||||
var projection = getProjection('EPSG:3857');
|
||||
var source = new _ol_source_WMTS_({
|
||||
var source = new WMTS({
|
||||
projection: projection,
|
||||
requestEncoding: 'REST',
|
||||
urls: [
|
||||
@@ -334,7 +334,7 @@ describe('ol.source.WMTS', function() {
|
||||
|
||||
describe('url option', function() {
|
||||
it('expands url template', function() {
|
||||
var tileSource = new _ol_source_WMTS_({
|
||||
var tileSource = new WMTS({
|
||||
url: '{1-3}'
|
||||
});
|
||||
|
||||
@@ -365,7 +365,7 @@ describe('ol.source.WMTS', function() {
|
||||
describe('using a "url" option', function() {
|
||||
beforeEach(function() {
|
||||
sourceOptions.url = 'some_wmts_url';
|
||||
source = new _ol_source_WMTS_(sourceOptions);
|
||||
source = new WMTS(sourceOptions);
|
||||
});
|
||||
|
||||
it('returns the WMTS URLs', function() {
|
||||
@@ -378,7 +378,7 @@ describe('ol.source.WMTS', function() {
|
||||
describe('using a "urls" option', function() {
|
||||
beforeEach(function() {
|
||||
sourceOptions.urls = ['some_wmts_url1', 'some_wmts_url2'];
|
||||
source = new _ol_source_WMTS_(sourceOptions);
|
||||
source = new WMTS(sourceOptions);
|
||||
});
|
||||
|
||||
it('returns the WMTS URLs', function() {
|
||||
@@ -395,7 +395,7 @@ describe('ol.source.WMTS', function() {
|
||||
var source;
|
||||
|
||||
beforeEach(function() {
|
||||
source = new _ol_source_WMTS_({
|
||||
source = new WMTS({
|
||||
layer: 'layer',
|
||||
style: 'default',
|
||||
matrixSet: 'foo',
|
||||
|
||||
Reference in New Issue
Block a user