Add documentation for API typedef functions
This commit is contained in:
@@ -2,7 +2,16 @@ goog.provide('ol.CanvasFunctionType');
|
||||
|
||||
|
||||
/**
|
||||
* A function returning the canvas element (`{HTMLCanvasElement}`)
|
||||
* used by the source as an image. The arguments passed to the function are:
|
||||
* {@link ol.Extent} the image extent, `{number}` the image resolution,
|
||||
* `{number}` the device pixel ratio, {@link ol.Size} the image size, and
|
||||
* {@link ol.proj.Projection} the image projection. The canvas returned by
|
||||
* this function is cached by the source. The this keyword inside the function
|
||||
* references the {@link ol.source.ImageCanvas}.
|
||||
*
|
||||
* @typedef {function(this:ol.source.ImageCanvas, ol.Extent, number,
|
||||
* number, ol.Size, ol.proj.Projection): HTMLCanvasElement}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.CanvasFunctionType;
|
||||
|
||||
@@ -7,7 +7,9 @@ goog.require('goog.math');
|
||||
|
||||
|
||||
/**
|
||||
* A function that formats a {@link ol.Coordinate} into a string.
|
||||
* A function that takes a {@link ol.Coordinate} and transforms it into a
|
||||
* `{string}`.
|
||||
*
|
||||
* @typedef {function((ol.Coordinate|undefined)): string}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,11 @@ goog.require('ol.MapBrowserEvent.EventType');
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.MapBrowserEvent} and returns a
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*
|
||||
* @typedef {function(ol.MapBrowserEvent): boolean}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.events.ConditionType;
|
||||
|
||||
|
||||
@@ -203,6 +203,11 @@ ol.Feature.prototype.setGeometryName = function(name) {
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes a `{number}` representing the view's resolution. It
|
||||
* returns an Array of {@link ol.style.Style}. This way individual features
|
||||
* can be styled. The this keyword inside the function references the
|
||||
* {@link ol.Feature} to be styled.
|
||||
*
|
||||
* @typedef {function(this: ol.Feature, number): Array.<ol.style.Style>}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
@@ -219,6 +224,10 @@ ol.feature.defaultFeatureStyleFunction = goog.functions.constant([]);
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.Feature} and a `{number}` representing
|
||||
* the view's resolution. The function should return an array of
|
||||
* {@link ol.style.Style}. This way e.g. a vector layer can be styled.
|
||||
*
|
||||
* @typedef {function(ol.Feature, number): Array.<ol.style.Style>}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,10 @@ goog.provide('ol.TileLoadFunctionType');
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.ImageTile} for the image tile and a
|
||||
* `{string}` for the src as arguments.
|
||||
*
|
||||
* @typedef {function(ol.ImageTile, string)}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.TileLoadFunctionType;
|
||||
|
||||
@@ -7,8 +7,15 @@ goog.require('ol.TileCoord');
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.TileCoord} for the tile coordinate,
|
||||
* a `{number}` representing the pixel ratio and an {@link ol.proj.Projection}
|
||||
* for the projection as arguments and returns a `{string}` or
|
||||
* undefined representing the tile URL. The this keyword inside the function
|
||||
* references the {@link ol.source.TileImage}.
|
||||
*
|
||||
* @typedef {function(this: ol.source.TileImage, ol.TileCoord,
|
||||
* number, ol.proj.Projection): (string|undefined)}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.TileUrlFunctionType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user