Improve tileLoadFunction docs

This commit is contained in:
Andreas Hocevar
2016-01-26 17:06:28 +01:00
parent 682e65fead
commit 52c6739b95
2 changed files with 69 additions and 24 deletions

View File

@@ -3943,7 +3943,12 @@ olx.source.BingMapsOptions.prototype.reprojectionErrorThreshold;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -4167,7 +4172,12 @@ olx.source.TileImageOptions.prototype.tileGrid;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -4313,7 +4323,13 @@ olx.source.VectorTileOptions.prototype.tileGrid;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(tile, url) {
* tile.setLoader(
* ol.featureloader.tile(url, tile.getFormat()));
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -4494,7 +4510,12 @@ olx.source.MapQuestOptions.prototype.reprojectionErrorThreshold;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -4595,7 +4616,12 @@ olx.source.OSMOptions.prototype.reprojectionErrorThreshold;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -5000,7 +5026,12 @@ olx.source.StamenOptions.prototype.reprojectionErrorThreshold;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -5188,7 +5219,12 @@ olx.source.TileArcGISRestOptions.prototype.reprojectionErrorThreshold;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -5275,7 +5311,12 @@ olx.source.TileJSONOptions.prototype.reprojectionErrorThreshold;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -5428,7 +5469,12 @@ olx.source.TileWMSOptions.prototype.serverType;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -5762,7 +5808,12 @@ olx.source.WMTSOptions.prototype.maxZoom;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */
@@ -5876,7 +5927,12 @@ olx.source.XYZOptions.prototype.tileGrid;
/** /**
* Optional function to load a tile given a URL. * Optional function to load a tile given a URL. The default is
* ```js
* function(imageTile, src) {
* imageTile.getImage().src = src;
* };
* ```
* @type {ol.TileLoadFunctionType|undefined} * @type {ol.TileLoadFunctionType|undefined}
* @api * @api
*/ */

View File

@@ -1,22 +1,11 @@
goog.provide('ol.TileLoadFunctionType'); goog.provide('ol.TileLoadFunctionType');
goog.provide('ol.TileVectorLoadFunctionType');
/** /**
* A function that takes an {@link ol.Tile} for the tile and a * A function that takes an {@link ol.Tile} for the tile and a `{string}` for
* `{string}` for the url as arguments. * the url as arguments.
* *
* @typedef {function(ol.Tile, string)} * @typedef {function(ol.Tile, string)}
* @api * @api
*/ */
ol.TileLoadFunctionType; ol.TileLoadFunctionType;
/**
* A function that is called with a tile url for the features to load and
* a callback that takes the loaded features as argument.
*
* @typedef {function(string, function(Array.<ol.Feature>))}
* @api
*/
ol.TileVectorLoadFunctionType;