Rename _ol_source_WMTSRequestEncoding_ to WMTSRequestEncoding
And add named export for `createFromCapabilitiesMatrixSet` function.
This commit is contained in:
@@ -5,7 +5,7 @@ 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 _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js';
|
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js';
|
||||||
import _ol_tilegrid_WMTS_ from '../src/ol/tilegrid/WMTS.js';
|
import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
|
||||||
|
|
||||||
|
|
||||||
// create the WMTS tile grid in the google projection
|
// create the WMTS tile grid in the google projection
|
||||||
@@ -18,7 +18,7 @@ for (var i = 0; i <= 14; i++) {
|
|||||||
matrixIds[i] = i;
|
matrixIds[i] = i;
|
||||||
resolutions[i] = tileSizeMtrs / Math.pow(2, i);
|
resolutions[i] = tileSizeMtrs / Math.pow(2, i);
|
||||||
}
|
}
|
||||||
var tileGrid = new _ol_tilegrid_WMTS_({
|
var tileGrid = new WMTSTileGrid({
|
||||||
origin: _ol_extent_.getTopLeft(projection.getExtent()),
|
origin: _ol_extent_.getTopLeft(projection.getExtent()),
|
||||||
resolutions: resolutions,
|
resolutions: resolutions,
|
||||||
matrixIds: matrixIds
|
matrixIds: matrixIds
|
||||||
|
|||||||
@@ -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 {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 _ol_source_WMTS_ from '../src/ol/source/WMTS.js';
|
||||||
import _ol_tilegrid_WMTS_ from '../src/ol/tilegrid/WMTS.js';
|
import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
|
||||||
|
|
||||||
|
|
||||||
var map = new Map({
|
var map = new Map({
|
||||||
@@ -31,7 +31,7 @@ for (var i = 0; i < 18; i++) {
|
|||||||
resolutions[i] = maxResolution / Math.pow(2, i);
|
resolutions[i] = maxResolution / Math.pow(2, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
var tileGrid = new _ol_tilegrid_WMTS_({
|
var tileGrid = new WMTSTileGrid({
|
||||||
origin: [-20037508, 20037508],
|
origin: [-20037508, 20037508],
|
||||||
resolutions: resolutions,
|
resolutions: resolutions,
|
||||||
matrixIds: matrixIds
|
matrixIds: matrixIds
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ 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 _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js';
|
import _ol_source_WMTS_ from '../src/ol/source/WMTS.js';
|
||||||
import _ol_tilegrid_WMTS_ from '../src/ol/tilegrid/WMTS.js';
|
import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
|
||||||
|
|
||||||
|
|
||||||
var projection = getProjection('EPSG:3857');
|
var projection = getProjection('EPSG:3857');
|
||||||
@@ -37,7 +37,7 @@ var map = new Map({
|
|||||||
matrixSet: 'EPSG:3857',
|
matrixSet: 'EPSG:3857',
|
||||||
format: 'image/png',
|
format: 'image/png',
|
||||||
projection: projection,
|
projection: projection,
|
||||||
tileGrid: new _ol_tilegrid_WMTS_({
|
tileGrid: new WMTSTileGrid({
|
||||||
origin: _ol_extent_.getTopLeft(projectionExtent),
|
origin: _ol_extent_.getTopLeft(projectionExtent),
|
||||||
resolutions: resolutions,
|
resolutions: resolutions,
|
||||||
matrixIds: matrixIds
|
matrixIds: matrixIds
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import {containsExtent} from '../extent.js';
|
|||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
import {get as getProjection, equivalent, transformExtent} from '../proj.js';
|
import {get as getProjection, equivalent, transformExtent} from '../proj.js';
|
||||||
import _ol_source_TileImage_ from '../source/TileImage.js';
|
import _ol_source_TileImage_ from '../source/TileImage.js';
|
||||||
import _ol_source_WMTSRequestEncoding_ from '../source/WMTSRequestEncoding.js';
|
import WMTSRequestEncoding from '../source/WMTSRequestEncoding.js';
|
||||||
import _ol_tilegrid_WMTS_ from '../tilegrid/WMTS.js';
|
import {createFromCapabilitiesMatrixSet} from '../tilegrid/WMTS.js';
|
||||||
import _ol_uri_ from '../uri.js';
|
import _ol_uri_ from '../uri.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,7 +75,7 @@ var _ol_source_WMTS_ = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.requestEncoding_ = options.requestEncoding !== undefined ?
|
this.requestEncoding_ = options.requestEncoding !== undefined ?
|
||||||
/** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) :
|
/** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) :
|
||||||
_ol_source_WMTSRequestEncoding_.KVP;
|
WMTSRequestEncoding.KVP;
|
||||||
|
|
||||||
var requestEncoding = this.requestEncoding_;
|
var requestEncoding = this.requestEncoding_;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ var _ol_source_WMTS_ = function(options) {
|
|||||||
'tilematrixset': this.matrixSet_
|
'tilematrixset': this.matrixSet_
|
||||||
};
|
};
|
||||||
|
|
||||||
if (requestEncoding == _ol_source_WMTSRequestEncoding_.KVP) {
|
if (requestEncoding == WMTSRequestEncoding.KVP) {
|
||||||
_ol_obj_.assign(context, {
|
_ol_obj_.assign(context, {
|
||||||
'Service': 'WMTS',
|
'Service': 'WMTS',
|
||||||
'Request': 'GetTile',
|
'Request': 'GetTile',
|
||||||
@@ -113,7 +113,7 @@ var _ol_source_WMTS_ = function(options) {
|
|||||||
// order conforms to wmts spec guidance, and so that we can avoid to escape
|
// order conforms to wmts spec guidance, and so that we can avoid to escape
|
||||||
// special template params
|
// special template params
|
||||||
|
|
||||||
template = (requestEncoding == _ol_source_WMTSRequestEncoding_.KVP) ?
|
template = (requestEncoding == WMTSRequestEncoding.KVP) ?
|
||||||
_ol_uri_.appendParams(template, context) :
|
_ol_uri_.appendParams(template, context) :
|
||||||
template.replace(/\{(\w+?)\}/g, function(m, p) {
|
template.replace(/\{(\w+?)\}/g, function(m, p) {
|
||||||
return (p.toLowerCase() in context) ? context[p.toLowerCase()] : m;
|
return (p.toLowerCase() in context) ? context[p.toLowerCase()] : m;
|
||||||
@@ -137,7 +137,7 @@ var _ol_source_WMTS_ = function(options) {
|
|||||||
};
|
};
|
||||||
_ol_obj_.assign(localContext, dimensions);
|
_ol_obj_.assign(localContext, dimensions);
|
||||||
var url = template;
|
var url = template;
|
||||||
if (requestEncoding == _ol_source_WMTSRequestEncoding_.KVP) {
|
if (requestEncoding == WMTSRequestEncoding.KVP) {
|
||||||
url = _ol_uri_.appendParams(url, localContext);
|
url = _ol_uri_.appendParams(url, localContext);
|
||||||
} else {
|
} else {
|
||||||
url = url.replace(/\{(\w+?)\}/g, function(m, p) {
|
url = url.replace(/\{(\w+?)\}/g, function(m, p) {
|
||||||
@@ -419,8 +419,7 @@ _ol_source_WMTS_.optionsFromCapabilities = function(wmtsCap, config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var tileGrid = _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet(
|
var tileGrid = createFromCapabilitiesMatrixSet(matrixSetObj, extent, matrixLimits);
|
||||||
matrixSetObj, extent, matrixLimits);
|
|
||||||
|
|
||||||
/** @type {!Array.<string>} */
|
/** @type {!Array.<string>} */
|
||||||
var urls = [];
|
var urls = [];
|
||||||
@@ -441,21 +440,21 @@ _ol_source_WMTS_.optionsFromCapabilities = function(wmtsCap, config) {
|
|||||||
// requestEncoding not provided, use the first encoding from the list
|
// requestEncoding not provided, use the first encoding from the list
|
||||||
requestEncoding = encodings[0];
|
requestEncoding = encodings[0];
|
||||||
}
|
}
|
||||||
if (requestEncoding === _ol_source_WMTSRequestEncoding_.KVP) {
|
if (requestEncoding === WMTSRequestEncoding.KVP) {
|
||||||
if (includes(encodings, _ol_source_WMTSRequestEncoding_.KVP)) {
|
if (includes(encodings, WMTSRequestEncoding.KVP)) {
|
||||||
urls.push(/** @type {string} */ (gets[i]['href']));
|
urls.push(/** @type {string} */ (gets[i]['href']));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (gets[i]['href']) {
|
} else if (gets[i]['href']) {
|
||||||
requestEncoding = _ol_source_WMTSRequestEncoding_.KVP;
|
requestEncoding = WMTSRequestEncoding.KVP;
|
||||||
urls.push(/** @type {string} */ (gets[i]['href']));
|
urls.push(/** @type {string} */ (gets[i]['href']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (urls.length === 0) {
|
if (urls.length === 0) {
|
||||||
requestEncoding = _ol_source_WMTSRequestEncoding_.REST;
|
requestEncoding = WMTSRequestEncoding.REST;
|
||||||
l['ResourceURL'].forEach(function(element) {
|
l['ResourceURL'].forEach(function(element) {
|
||||||
if (element['resourceType'] === 'tile') {
|
if (element['resourceType'] === 'tile') {
|
||||||
format = element['format'];
|
format = element['format'];
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import _ol_tilegrid_TileGrid_ from '../tilegrid/TileGrid.js';
|
|||||||
* @struct
|
* @struct
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_tilegrid_WMTS_ = function(options) {
|
var WMTSTileGrid = function(options) {
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Array.<string>}
|
* @type {!Array.<string>}
|
||||||
@@ -35,14 +35,14 @@ var _ol_tilegrid_WMTS_ = function(options) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_tilegrid_WMTS_, _ol_tilegrid_TileGrid_);
|
inherits(WMTSTileGrid, _ol_tilegrid_TileGrid_);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} z Z.
|
* @param {number} z Z.
|
||||||
* @return {string} MatrixId..
|
* @return {string} MatrixId..
|
||||||
*/
|
*/
|
||||||
_ol_tilegrid_WMTS_.prototype.getMatrixId = function(z) {
|
WMTSTileGrid.prototype.getMatrixId = function(z) {
|
||||||
return this.matrixIds_[z];
|
return this.matrixIds_[z];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,10 +52,11 @@ _ol_tilegrid_WMTS_.prototype.getMatrixId = function(z) {
|
|||||||
* @return {Array.<string>} MatrixIds.
|
* @return {Array.<string>} MatrixIds.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_tilegrid_WMTS_.prototype.getMatrixIds = function() {
|
WMTSTileGrid.prototype.getMatrixIds = function() {
|
||||||
return this.matrixIds_;
|
return this.matrixIds_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default WMTSTileGrid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a tile grid from a WMTS capabilities matrix set and an
|
* Create a tile grid from a WMTS capabilities matrix set and an
|
||||||
@@ -69,8 +70,7 @@ _ol_tilegrid_WMTS_.prototype.getMatrixIds = function() {
|
|||||||
* @return {ol.tilegrid.WMTS} WMTS tileGrid instance.
|
* @return {ol.tilegrid.WMTS} WMTS tileGrid instance.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet = function(matrixSet, opt_extent,
|
export function createFromCapabilitiesMatrixSet(matrixSet, opt_extent, opt_matrixLimits) {
|
||||||
opt_matrixLimits) {
|
|
||||||
|
|
||||||
/** @type {!Array.<number>} */
|
/** @type {!Array.<number>} */
|
||||||
var resolutions = [];
|
var resolutions = [];
|
||||||
@@ -137,7 +137,7 @@ _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet = function(matrixSet, opt_ext
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return new _ol_tilegrid_WMTS_({
|
return new WMTSTileGrid({
|
||||||
extent: opt_extent,
|
extent: opt_extent,
|
||||||
origins: origins,
|
origins: origins,
|
||||||
resolutions: resolutions,
|
resolutions: resolutions,
|
||||||
@@ -145,5 +145,4 @@ _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet = function(matrixSet, opt_ext
|
|||||||
tileSizes: tileSizes,
|
tileSizes: tileSizes,
|
||||||
sizes: sizes
|
sizes: sizes
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
export default _ol_tilegrid_WMTS_;
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_format_WMTSCapabilities_ from '../../../../src/ol/format/WMTSCapabilities.js';
|
import _ol_format_WMTSCapabilities_ from '../../../../src/ol/format/WMTSCapabilities.js';
|
||||||
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 _ol_tilegrid_WMTS_ 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 _ol_source_WMTS_ from '../../../../src/ol/source/WMTS.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
|
|
||||||
expect(options.requestEncoding).to.be.eql('KVP');
|
expect(options.requestEncoding).to.be.eql('KVP');
|
||||||
|
|
||||||
expect(options.tileGrid).to.be.a(_ol_tilegrid_WMTS_);
|
expect(options.tileGrid).to.be.a(WMTSTileGrid);
|
||||||
|
|
||||||
expect(options.style).to.be.eql('DarkBlue');
|
expect(options.style).to.be.eql('DarkBlue');
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
|
|
||||||
expect(options.requestEncoding).to.be.eql('REST');
|
expect(options.requestEncoding).to.be.eql('REST');
|
||||||
|
|
||||||
expect(options.tileGrid).to.be.a(_ol_tilegrid_WMTS_);
|
expect(options.tileGrid).to.be.a(WMTSTileGrid);
|
||||||
|
|
||||||
expect(options.style).to.be.eql('DarkBlue');
|
expect(options.style).to.be.eql('DarkBlue');
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
'{tilematrixset}/{TileMatrix}/{TileCol}/{TileRow}.jpg'],
|
'{tilematrixset}/{TileMatrix}/{TileCol}/{TileRow}.jpg'],
|
||||||
matrixSet: 'EPSG:3857',
|
matrixSet: 'EPSG:3857',
|
||||||
requestEncoding: 'REST',
|
requestEncoding: 'REST',
|
||||||
tileGrid: new _ol_tilegrid_WMTS_({
|
tileGrid: new WMTSTileGrid({
|
||||||
origin: [-20037508.342789244, 20037508.342789244],
|
origin: [-20037508.342789244, 20037508.342789244],
|
||||||
resolutions: [559082264.029 * 0.28E-3,
|
resolutions: [559082264.029 * 0.28E-3,
|
||||||
279541132.015 * 0.28E-3,
|
279541132.015 * 0.28E-3,
|
||||||
@@ -213,7 +213,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
'{tilematrixset}/{TileMatrix}/{TileCol}/{TileRow}.jpg'],
|
'{tilematrixset}/{TileMatrix}/{TileCol}/{TileRow}.jpg'],
|
||||||
matrixSet: 'EPSG:3857',
|
matrixSet: 'EPSG:3857',
|
||||||
requestEncoding: 'REST',
|
requestEncoding: 'REST',
|
||||||
tileGrid: new _ol_tilegrid_WMTS_({
|
tileGrid: new WMTSTileGrid({
|
||||||
origin: [-20037508.342789244, 20037508.342789244],
|
origin: [-20037508.342789244, 20037508.342789244],
|
||||||
resolutions: [559082264.029 * 0.28E-3,
|
resolutions: [559082264.029 * 0.28E-3,
|
||||||
279541132.015 * 0.28E-3,
|
279541132.015 * 0.28E-3,
|
||||||
@@ -315,7 +315,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
'http://1.example.com/{TileMatrix}/{TileRow}/{TileCol}.jpeg',
|
'http://1.example.com/{TileMatrix}/{TileRow}/{TileCol}.jpeg',
|
||||||
'http://2.example.com/{TileMatrix}/{TileRow}/{TileCol}.jpeg'
|
'http://2.example.com/{TileMatrix}/{TileRow}/{TileCol}.jpeg'
|
||||||
],
|
],
|
||||||
tileGrid: new _ol_tilegrid_WMTS_({
|
tileGrid: new WMTSTileGrid({
|
||||||
matrixIds: [0, 1, 2, 3, 4, 5, 6, 7],
|
matrixIds: [0, 1, 2, 3, 4, 5, 6, 7],
|
||||||
origin: [2690000, 1285000],
|
origin: [2690000, 1285000],
|
||||||
resolutions: [4000, 3750, 3500, 3250, 3000, 2750, 2500, 2250]
|
resolutions: [4000, 3750, 3500, 3250, 3000, 2750, 2500, 2250]
|
||||||
@@ -354,7 +354,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
style: 'default',
|
style: 'default',
|
||||||
matrixSet: 'foo',
|
matrixSet: 'foo',
|
||||||
requestEncoding: 'REST',
|
requestEncoding: 'REST',
|
||||||
tileGrid: new _ol_tilegrid_WMTS_({
|
tileGrid: new WMTSTileGrid({
|
||||||
origin: [0, 0],
|
origin: [0, 0],
|
||||||
resolutions: [],
|
resolutions: [],
|
||||||
matrixIds: []
|
matrixIds: []
|
||||||
@@ -400,7 +400,7 @@ describe('ol.source.WMTS', function() {
|
|||||||
style: 'default',
|
style: 'default',
|
||||||
matrixSet: 'foo',
|
matrixSet: 'foo',
|
||||||
requestEncoding: 'REST',
|
requestEncoding: 'REST',
|
||||||
tileGrid: new _ol_tilegrid_WMTS_({
|
tileGrid: new WMTSTileGrid({
|
||||||
origin: [0, 0],
|
origin: [0, 0],
|
||||||
resolutions: [],
|
resolutions: [],
|
||||||
matrixIds: []
|
matrixIds: []
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_format_WMTSCapabilities_ from '../../../../src/ol/format/WMTSCapabilities.js';
|
import _ol_format_WMTSCapabilities_ from '../../../../src/ol/format/WMTSCapabilities.js';
|
||||||
import _ol_tilegrid_WMTS_ from '../../../../src/ol/tilegrid/WMTS.js';
|
import {createFromCapabilitiesMatrixSet} from '../../../../src/ol/tilegrid/WMTS.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.tilegrid.WMTS', function() {
|
describe('ol.tilegrid.WMTS', function() {
|
||||||
@@ -21,9 +21,7 @@ describe('ol.tilegrid.WMTS', function() {
|
|||||||
it('can create tileGrid for EPSG:3857',
|
it('can create tileGrid for EPSG:3857',
|
||||||
function() {
|
function() {
|
||||||
var matrixSetObj = capabilities.Contents.TileMatrixSet[0];
|
var matrixSetObj = capabilities.Contents.TileMatrixSet[0];
|
||||||
var tileGrid;
|
var tileGrid = createFromCapabilitiesMatrixSet(matrixSetObj);
|
||||||
tileGrid = _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet(
|
|
||||||
matrixSetObj);
|
|
||||||
expect(tileGrid.matrixIds_).to.be.an('array');
|
expect(tileGrid.matrixIds_).to.be.an('array');
|
||||||
expect(tileGrid.matrixIds_).to.have.length(20);
|
expect(tileGrid.matrixIds_).to.have.length(20);
|
||||||
expect(tileGrid.matrixIds_).to.eql([
|
expect(tileGrid.matrixIds_).to.eql([
|
||||||
@@ -76,9 +74,7 @@ describe('ol.tilegrid.WMTS', function() {
|
|||||||
it('can create tileGrid for EPSG:3857 without matrixLimits',
|
it('can create tileGrid for EPSG:3857 without matrixLimits',
|
||||||
function() {
|
function() {
|
||||||
var matrixSetObj = capabilities.Contents.TileMatrixSet[0];
|
var matrixSetObj = capabilities.Contents.TileMatrixSet[0];
|
||||||
var tileGrid;
|
var tileGrid = createFromCapabilitiesMatrixSet(matrixSetObj);
|
||||||
tileGrid = _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet(
|
|
||||||
matrixSetObj);
|
|
||||||
expect(tileGrid.matrixIds_).to.be.an('array');
|
expect(tileGrid.matrixIds_).to.be.an('array');
|
||||||
expect(tileGrid.matrixIds_).to.have.length(22);
|
expect(tileGrid.matrixIds_).to.have.length(22);
|
||||||
expect(tileGrid.matrixIds_).to.eql([
|
expect(tileGrid.matrixIds_).to.eql([
|
||||||
@@ -117,9 +113,7 @@ describe('ol.tilegrid.WMTS', function() {
|
|||||||
var matrixSetObj = capabilities.Contents.TileMatrixSet[0];
|
var matrixSetObj = capabilities.Contents.TileMatrixSet[0];
|
||||||
var matrixLimitArray = capabilities.Contents.Layer[0]
|
var matrixLimitArray = capabilities.Contents.Layer[0]
|
||||||
.TileMatrixSetLink[0].TileMatrixSetLimits;
|
.TileMatrixSetLink[0].TileMatrixSetLimits;
|
||||||
var tileGrid;
|
var tileGrid = createFromCapabilitiesMatrixSet(matrixSetObj, undefined, matrixLimitArray);
|
||||||
tileGrid = _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet(
|
|
||||||
matrixSetObj, undefined, matrixLimitArray);
|
|
||||||
expect(tileGrid.matrixIds_).to.be.an('array');
|
expect(tileGrid.matrixIds_).to.be.an('array');
|
||||||
expect(tileGrid.matrixIds_).to.have.length(20);
|
expect(tileGrid.matrixIds_).to.have.length(20);
|
||||||
expect(tileGrid.matrixIds_).to.eql([
|
expect(tileGrid.matrixIds_).to.eql([
|
||||||
|
|||||||
Reference in New Issue
Block a user