diff --git a/src/ol/imageurlfunction.js b/src/ol/imageurlfunction.js index ebddedebdb..95a9a0a99b 100644 --- a/src/ol/imageurlfunction.js +++ b/src/ol/imageurlfunction.js @@ -5,8 +5,8 @@ goog.require('ol.Size'); /** - * @typedef {function(this:ol.source.Source, ol.Extent, ol.Size, ol.Projection): - * (string|undefined)} + * @typedef {function(this:ol.source.ImageSource, ol.Extent, ol.Size, + * ol.Projection): (string|undefined)} */ ol.ImageUrlFunctionType; @@ -22,6 +22,7 @@ ol.ImageUrlFunction.createFromParamsFunction = function(baseUrl, params, paramsFunction) { return ( /** + * @this {ol.source.ImageSource} * @param {ol.Extent} extent Extent. * @param {ol.Size} size Size. * @param {ol.Projection} projection Projection. @@ -34,6 +35,7 @@ ol.ImageUrlFunction.createFromParamsFunction = /** + * @this {ol.source.ImageSource} * @param {ol.Extent} extent Extent. * @param {ol.Size} size Size. * @return {string|undefined} Image URL. diff --git a/src/ol/source/bingmapssource.js b/src/ol/source/bingmapssource.js index 226138140f..ceb5588d04 100644 --- a/src/ol/source/bingmapssource.js +++ b/src/ol/source/bingmapssource.js @@ -88,6 +88,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = .replace('{culture}', culture); return ( /** + * @this {ol.source.BingMaps} * @param {ol.TileCoord} tileCoord Tile coordinate. * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL. diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 0e5a0312fa..12132d7d45 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -75,10 +75,12 @@ ol.source.WMTS = function(options) { function createFromWMTSTemplate(template) { return ( /** + * @this {ol.source.WMTS} * @param {ol.TileCoord} tileCoord Tile coordinate. + * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL. */ - function(tileCoord) { + function(tileCoord, projection) { if (goog.isNull(tileCoord)) { return undefined; } else { @@ -92,7 +94,6 @@ ol.source.WMTS = function(options) { } var url = template; for (var key in localContext) { - // FIXME: should we filter properties with hasOwnProperty? url = url.replace('{' + key + '}', localContext[key]) .replace('%7B' + key + '%7D', localContext[key]); } @@ -122,7 +123,13 @@ ol.source.WMTS = function(options) { var tmpExtent = ol.extent.createEmpty(); var tmpTileCoord = new ol.TileCoord(0, 0, 0); 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(); goog.asserts.assert(!goog.isNull(tileGrid)); if (tileGrid.getResolutions().length <= tileCoord.z) { diff --git a/src/ol/tileurlfunction.js b/src/ol/tileurlfunction.js index 545ae0e6a3..4ba3922ddf 100644 --- a/src/ol/tileurlfunction.js +++ b/src/ol/tileurlfunction.js @@ -8,7 +8,8 @@ goog.require('ol.extent'); /** - * @typedef {function(ol.TileCoord, ol.Projection): (string|undefined)} + * @typedef {function(this: ol.source.ImageTileSource, ol.TileCoord, + * ol.Projection): (string|undefined)} */ ol.TileUrlFunctionType; @@ -20,6 +21,7 @@ ol.TileUrlFunctionType; ol.TileUrlFunction.createFromTemplate = function(template) { return ( /** + * @this {ol.source.ImageTileSource} * @param {ol.TileCoord} tileCoord Tile Coordinate. * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL. @@ -56,6 +58,7 @@ ol.TileUrlFunction.createFromTileUrlFunctions = function(tileUrlFunctions) { } return ( /** + * @this {ol.source.ImageTileSource} * @param {ol.TileCoord} tileCoord Tile Coordinate. * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL. @@ -84,6 +87,7 @@ ol.TileUrlFunction.createFromParamsFunction = var tmpExtent = ol.extent.createEmpty(); return ( /** + * @this {ol.source.ImageTileSource} * @param {ol.TileCoord} tileCoord Tile Coordinate. * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL. @@ -106,6 +110,7 @@ ol.TileUrlFunction.createFromParamsFunction = /** + * @this {ol.source.ImageTileSource} * @param {ol.TileCoord} tileCoord Tile coordinate. * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL. @@ -126,6 +131,7 @@ ol.TileUrlFunction.withTileCoordTransform = var tmpTileCoord = new ol.TileCoord(0, 0, 0); return ( /** + * @this {ol.source.ImageTileSource} * @param {ol.TileCoord} tileCoord Tile Coordinate. * @param {ol.Projection} projection Projection. * @return {string|undefined} Tile URL.