From 5a2c206cab81cfd59b9a0fc4b82aab960bfae0a4 Mon Sep 17 00:00:00 2001 From: Mike McGann Date: Tue, 14 Oct 2014 12:38:08 -0400 Subject: [PATCH] ol.source.WMTS now passes tileClass option to ol.source.TileImage The constructor for ol.source.TileImage accepts an option for the tileClass, but ol.source.WMTS does not pass this to the parent. This pull request adds that in. --- externs/olx.js | 17 +++++++++++++++-- src/ol/source/wmtssource.js | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 279396a59a..8669a9ad4d 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -3599,7 +3599,7 @@ olx.source.TileImageOptions.prototype.state; /** - * tile class + * Class used to instantiate image tiles. Default is {@link ol.ImageTile}. * @type {function(new: ol.ImageTile, ol.TileCoord, * ol.TileState, string, ?string, * ol.TileLoadFunctionType)|undefined} @@ -4996,7 +4996,10 @@ olx.source.StaticVectorOptions.prototype.urls; * url: (string|undefined), * maxZoom: (number|undefined), * tileLoadFunction: (ol.TileLoadFunctionType|undefined), - * urls: (Array.|undefined)}} + * urls: (Array.|undefined), + * tileClass: (function(new: ol.ImageTile, ol.TileCoord, + * ol.TileState, string, ?string, + * ol.TileLoadFunctionType)|undefined)}} * @api */ olx.source.WMTSOptions; @@ -5066,6 +5069,16 @@ olx.source.WMTSOptions.prototype.layer; olx.source.WMTSOptions.prototype.style; +/** + * Class used to instantiate image tiles. Default is {@link ol.ImageTile}. + * @type {function(new: ol.ImageTile, ol.TileCoord, + * ol.TileState, string, ?string, + * ol.TileLoadFunctionType)|undefined} + * @api + */ +olx.source.WMTSOptions.prototype.tileClass; + + /** * The pixel ratio used by the tile service. For example, if the tile * service advertizes 256px by 256px tiles but actually sends 512px diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 4b66dfd216..0d37688c8c 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -181,6 +181,7 @@ ol.source.WMTS = function(options) { crossOrigin: options.crossOrigin, logo: options.logo, projection: options.projection, + tileClass: options.tileClass, tileGrid: tileGrid, tileLoadFunction: options.tileLoadFunction, tilePixelRatio: options.tilePixelRatio,