Be stricter with types in WMTS
This commit is contained in:
@@ -75,10 +75,12 @@ ol.source.WMTS = function(options) {
|
|||||||
function createFromWMTSTemplate(template) {
|
function createFromWMTSTemplate(template) {
|
||||||
return (
|
return (
|
||||||
/**
|
/**
|
||||||
|
* @this {ol.source.WMTS}
|
||||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||||
|
* @param {ol.Projection} projection Projection.
|
||||||
* @return {string|undefined} Tile URL.
|
* @return {string|undefined} Tile URL.
|
||||||
*/
|
*/
|
||||||
function(tileCoord) {
|
function(tileCoord, projection) {
|
||||||
if (goog.isNull(tileCoord)) {
|
if (goog.isNull(tileCoord)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
} else {
|
} else {
|
||||||
@@ -122,7 +124,13 @@ ol.source.WMTS = function(options) {
|
|||||||
var tmpExtent = ol.extent.createEmpty();
|
var tmpExtent = ol.extent.createEmpty();
|
||||||
var tmpTileCoord = new ol.TileCoord(0, 0, 0);
|
var tmpTileCoord = new ol.TileCoord(0, 0, 0);
|
||||||
tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform(
|
tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform(
|
||||||
function(tileCoord, projection) {
|
/**
|
||||||
|
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||||
|
* @param {ol.Projection} projection Projection.
|
||||||
|
* @param {ol.TileCoord=} opt_tileCoord Tile coordinate.
|
||||||
|
* @return {ol.TileCoord} Tile coordinate.
|
||||||
|
*/
|
||||||
|
function(tileCoord, projection, opt_tileCoord) {
|
||||||
var tileGrid = this.getTileGrid();
|
var tileGrid = this.getTileGrid();
|
||||||
goog.asserts.assert(!goog.isNull(tileGrid));
|
goog.asserts.assert(!goog.isNull(tileGrid));
|
||||||
if (tileGrid.getResolutions().length <= tileCoord.z) {
|
if (tileGrid.getResolutions().length <= tileCoord.z) {
|
||||||
|
|||||||
Reference in New Issue
Block a user