Rename _ol_source_WMTS_ to WMTS

This commit is contained in:
Tim Schaub
2018-01-08 16:06:42 -07:00
parent ecd1343d75
commit 2440d52ebe
8 changed files with 51 additions and 51 deletions

View File

@@ -8,7 +8,7 @@ import {register} from '../src/ol/proj/proj4.js';
import OSM from '../src/ol/source/OSM.js'; import OSM from '../src/ol/source/OSM.js';
import TileImage from '../src/ol/source/TileImage.js'; import TileImage from '../src/ol/source/TileImage.js';
import TileWMS from '../src/ol/source/TileWMS.js'; import TileWMS from '../src/ol/source/TileWMS.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; import WMTS from '../src/ol/source/WMTS.js';
import XYZ from '../src/ol/source/XYZ.js'; import XYZ from '../src/ol/source/XYZ.js';
import TileGrid from '../src/ol/tilegrid/TileGrid.js'; import TileGrid from '../src/ol/tilegrid/TileGrid.js';
import proj4 from 'proj4'; import proj4 from 'proj4';
@@ -104,7 +104,7 @@ fetch(url).then(function(response) {
return response.text(); return response.text();
}).then(function(text) { }).then(function(text) {
var result = parser.read(text); var result = parser.read(text);
var options = _ol_source_WMTS_.optionsFromCapabilities(result, { var options = WMTS.optionsFromCapabilities(result, {
layer: 'OSM_Land_Mask', layer: 'OSM_Land_Mask',
matrixSet: 'EPSG3413_250m' matrixSet: 'EPSG3413_250m'
}); });
@@ -112,7 +112,7 @@ fetch(url).then(function(response) {
options.projection = 'EPSG:3413'; options.projection = 'EPSG:3413';
options.wrapX = false; options.wrapX = false;
layers['wmts3413'] = new TileLayer({ layers['wmts3413'] = new TileLayer({
source: new _ol_source_WMTS_(/** @type {!olx.source.WMTSOptions} */ (options)) source: new WMTS(/** @type {!olx.source.WMTSOptions} */ (options))
}); });
}); });

View File

@@ -4,7 +4,7 @@ import * as _ol_extent_ from '../src/ol/extent.js';
import TileLayer from '../src/ol/layer/Tile.js'; import TileLayer from '../src/ol/layer/Tile.js';
import {get as getProjection} from '../src/ol/proj.js'; import {get as getProjection} from '../src/ol/proj.js';
import OSM from '../src/ol/source/OSM.js'; import OSM from '../src/ol/source/OSM.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; import WMTS from '../src/ol/source/WMTS.js';
import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js'; import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
@@ -26,7 +26,7 @@ var tileGrid = new WMTSTileGrid({
var scalgoToken = 'CC5BF28A7D96B320C7DFBFD1236B5BEB'; var scalgoToken = 'CC5BF28A7D96B320C7DFBFD1236B5BEB';
var wmtsSource = new _ol_source_WMTS_({ var wmtsSource = new WMTS({
url: 'http://ts2.scalgo.com/olpatch/wmts?token=' + scalgoToken, url: 'http://ts2.scalgo.com/olpatch/wmts?token=' + scalgoToken,
layer: 'SRTM_4_1:SRTM_4_1_flooded_sealevels', layer: 'SRTM_4_1:SRTM_4_1_flooded_sealevels',
format: 'image/png', format: 'image/png',

View File

@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
import _ol_format_WMTSCapabilities_ from '../src/ol/format/WMTSCapabilities.js'; import _ol_format_WMTSCapabilities_ from '../src/ol/format/WMTSCapabilities.js';
import _ol_has_ from '../src/ol/has.js'; import _ol_has_ from '../src/ol/has.js';
import TileLayer from '../src/ol/layer/Tile.js'; import TileLayer from '../src/ol/layer/Tile.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; import WMTS from '../src/ol/source/WMTS.js';
var capabilitiesUrl = 'https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml'; var capabilitiesUrl = 'https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml';
@@ -27,13 +27,13 @@ fetch(capabilitiesUrl).then(function(response) {
return response.text(); return response.text();
}).then(function(text) { }).then(function(text) {
var result = new _ol_format_WMTSCapabilities_().read(text); var result = new _ol_format_WMTSCapabilities_().read(text);
var options = _ol_source_WMTS_.optionsFromCapabilities(result, { var options = WMTS.optionsFromCapabilities(result, {
layer: layer, layer: layer,
matrixSet: 'google3857', matrixSet: 'google3857',
style: 'normal' style: 'normal'
}); });
options.tilePixelRatio = tilePixelRatio; options.tilePixelRatio = tilePixelRatio;
map.addLayer(new TileLayer({ map.addLayer(new TileLayer({
source: new _ol_source_WMTS_(/** @type {!olx.source.WMTSOptions} */ (options)) source: new WMTS(/** @type {!olx.source.WMTSOptions} */ (options))
})); }));
}); });

View File

@@ -4,7 +4,7 @@ import {defaults as defaultControls} from '../src/ol/control.js';
import * as _ol_extent_ from '../src/ol/extent.js'; import * as _ol_extent_ from '../src/ol/extent.js';
import TileLayer from '../src/ol/layer/Tile.js'; import TileLayer from '../src/ol/layer/Tile.js';
import {fromLonLat, get as getProjection} from '../src/ol/proj.js'; import {fromLonLat, get as getProjection} from '../src/ol/proj.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; import WMTS from '../src/ol/source/WMTS.js';
import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js'; import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
@@ -41,7 +41,7 @@ var tileGrid = new WMTSTileGrid({
// Expiration date is 06/29/2018. // Expiration date is 06/29/2018.
var key = '2mqbg0z6cx7ube8gsou10nrt'; var key = '2mqbg0z6cx7ube8gsou10nrt';
var ign_source = new _ol_source_WMTS_({ var ign_source = new WMTS({
url: 'https://wxs.ign.fr/' + key + '/wmts', url: 'https://wxs.ign.fr/' + key + '/wmts',
layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS', layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
matrixSet: 'PM', matrixSet: 'PM',

View File

@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
import _ol_format_WMTSCapabilities_ from '../src/ol/format/WMTSCapabilities.js'; import _ol_format_WMTSCapabilities_ from '../src/ol/format/WMTSCapabilities.js';
import TileLayer from '../src/ol/layer/Tile.js'; import TileLayer from '../src/ol/layer/Tile.js';
import OSM from '../src/ol/source/OSM.js'; import OSM from '../src/ol/source/OSM.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; import WMTS from '../src/ol/source/WMTS.js';
var parser = new _ol_format_WMTSCapabilities_(); var parser = new _ol_format_WMTSCapabilities_();
var map; var map;
@@ -12,7 +12,7 @@ fetch('data/WMTSCapabilities.xml').then(function(response) {
return response.text(); return response.text();
}).then(function(text) { }).then(function(text) {
var result = parser.read(text); var result = parser.read(text);
var options = _ol_source_WMTS_.optionsFromCapabilities(result, { var options = WMTS.optionsFromCapabilities(result, {
layer: 'layer-7328', layer: 'layer-7328',
matrixSet: 'EPSG:3857' matrixSet: 'EPSG:3857'
}); });
@@ -25,7 +25,7 @@ fetch('data/WMTSCapabilities.xml').then(function(response) {
}), }),
new TileLayer({ new TileLayer({
opacity: 1, opacity: 1,
source: new _ol_source_WMTS_(/** @type {!olx.source.WMTSOptions} */ (options)) source: new WMTS(/** @type {!olx.source.WMTSOptions} */ (options))
}) })
], ],
target: 'map', target: 'map',

View File

@@ -5,7 +5,7 @@ import * as _ol_extent_ from '../src/ol/extent.js';
import TileLayer from '../src/ol/layer/Tile.js'; import TileLayer from '../src/ol/layer/Tile.js';
import {get as getProjection} from '../src/ol/proj.js'; import {get as getProjection} from '../src/ol/proj.js';
import OSM from '../src/ol/source/OSM.js'; import OSM from '../src/ol/source/OSM.js';
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; import WMTS from '../src/ol/source/WMTS.js';
import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js'; import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
@@ -28,7 +28,7 @@ var map = new Map({
}), }),
new TileLayer({ new TileLayer({
opacity: 0.7, opacity: 0.7,
source: new _ol_source_WMTS_({ source: new WMTS({
attributions: 'Tiles © <a href="https://services.arcgisonline.com/arcgis/rest/' + attributions: 'Tiles © <a href="https://services.arcgisonline.com/arcgis/rest/' +
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>', 'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>',
url: 'https://services.arcgisonline.com/arcgis/rest/' + url: 'https://services.arcgisonline.com/arcgis/rest/' +

View File

@@ -21,7 +21,7 @@ import _ol_uri_ from '../uri.js';
* @param {olx.source.WMTSOptions} options WMTS options. * @param {olx.source.WMTSOptions} options WMTS options.
* @api * @api
*/ */
var _ol_source_WMTS_ = function(options) { var WMTS = function(options) {
// TODO: add support for TileMatrixLimits // TODO: add support for TileMatrixLimits
@@ -173,14 +173,14 @@ var _ol_source_WMTS_ = function(options) {
}; };
inherits(_ol_source_WMTS_, TileImage); inherits(WMTS, TileImage);
/** /**
* Set the URLs to use for requests. * Set the URLs to use for requests.
* URLs may contain OCG conform URL Template Variables: {TileMatrix}, {TileRow}, {TileCol}. * URLs may contain OCG conform URL Template Variables: {TileMatrix}, {TileRow}, {TileCol}.
* @override * @override
*/ */
_ol_source_WMTS_.prototype.setUrls = function(urls) { WMTS.prototype.setUrls = function(urls) {
this.urls = urls; this.urls = urls;
var key = urls.join('\n'); var key = urls.join('\n');
this.setTileUrlFunction(this.fixedTileUrlFunction ? this.setTileUrlFunction(this.fixedTileUrlFunction ?
@@ -195,7 +195,7 @@ _ol_source_WMTS_.prototype.setUrls = function(urls) {
* @return {!Object} Dimensions. * @return {!Object} Dimensions.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getDimensions = function() { WMTS.prototype.getDimensions = function() {
return this.dimensions_; return this.dimensions_;
}; };
@@ -205,7 +205,7 @@ _ol_source_WMTS_.prototype.getDimensions = function() {
* @return {string} Format. * @return {string} Format.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getFormat = function() { WMTS.prototype.getFormat = function() {
return this.format_; return this.format_;
}; };
@@ -215,7 +215,7 @@ _ol_source_WMTS_.prototype.getFormat = function() {
* @return {string} Layer. * @return {string} Layer.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getLayer = function() { WMTS.prototype.getLayer = function() {
return this.layer_; return this.layer_;
}; };
@@ -225,7 +225,7 @@ _ol_source_WMTS_.prototype.getLayer = function() {
* @return {string} MatrixSet. * @return {string} MatrixSet.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getMatrixSet = function() { WMTS.prototype.getMatrixSet = function() {
return this.matrixSet_; return this.matrixSet_;
}; };
@@ -235,7 +235,7 @@ _ol_source_WMTS_.prototype.getMatrixSet = function() {
* @return {ol.source.WMTSRequestEncoding} Request encoding. * @return {ol.source.WMTSRequestEncoding} Request encoding.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getRequestEncoding = function() { WMTS.prototype.getRequestEncoding = function() {
return this.requestEncoding_; return this.requestEncoding_;
}; };
@@ -245,7 +245,7 @@ _ol_source_WMTS_.prototype.getRequestEncoding = function() {
* @return {string} Style. * @return {string} Style.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getStyle = function() { WMTS.prototype.getStyle = function() {
return this.style_; return this.style_;
}; };
@@ -255,7 +255,7 @@ _ol_source_WMTS_.prototype.getStyle = function() {
* @return {string} Version. * @return {string} Version.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.getVersion = function() { WMTS.prototype.getVersion = function() {
return this.version_; return this.version_;
}; };
@@ -264,7 +264,7 @@ _ol_source_WMTS_.prototype.getVersion = function() {
* @private * @private
* @return {string} The key for the current dimensions. * @return {string} The key for the current dimensions.
*/ */
_ol_source_WMTS_.prototype.getKeyForDimensions_ = function() { WMTS.prototype.getKeyForDimensions_ = function() {
var i = 0; var i = 0;
var res = []; var res = [];
for (var key in this.dimensions_) { for (var key in this.dimensions_) {
@@ -279,7 +279,7 @@ _ol_source_WMTS_.prototype.getKeyForDimensions_ = function() {
* @param {Object} dimensions Dimensions. * @param {Object} dimensions Dimensions.
* @api * @api
*/ */
_ol_source_WMTS_.prototype.updateDimensions = function(dimensions) { WMTS.prototype.updateDimensions = function(dimensions) {
_ol_obj_.assign(this.dimensions_, dimensions); _ol_obj_.assign(this.dimensions_, dimensions);
this.setKey(this.getKeyForDimensions_()); this.setKey(this.getKeyForDimensions_());
}; };
@@ -309,7 +309,7 @@ _ol_source_WMTS_.prototype.updateDimensions = function(dimensions) {
* @return {?olx.source.WMTSOptions} WMTS source options object or `null` if the layer was not found. * @return {?olx.source.WMTSOptions} WMTS source options object or `null` if the layer was not found.
* @api * @api
*/ */
_ol_source_WMTS_.optionsFromCapabilities = function(wmtsCap, config) { WMTS.optionsFromCapabilities = function(wmtsCap, config) {
var layers = wmtsCap['Contents']['Layer']; var layers = wmtsCap['Contents']['Layer'];
var l = find(layers, function(elt, index, array) { var l = find(layers, function(elt, index, array) {
return elt['Identifier'] == config['layer']; return elt['Identifier'] == config['layer'];
@@ -477,4 +477,4 @@ _ol_source_WMTS_.optionsFromCapabilities = function(wmtsCap, config) {
crossOrigin: config['crossOrigin'] crossOrigin: config['crossOrigin']
}; };
}; };
export default _ol_source_WMTS_; export default WMTS;

View File

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