Set api annotation on classdesc, not constructor

This commit is contained in:
ahocevar
2018-07-21 17:25:22 +02:00
parent 2767ddfdc7
commit bbe0a66d07
101 changed files with 484 additions and 382 deletions
+17 -7
View File
@@ -21,16 +21,26 @@ import {createCanvasContext2D} from '../dom.js';
* @property {HTMLCanvasElement} image
*/
/**
* @classesc
* This class facilitates the creation of image atlases.
*
* Images added to an atlas will be rendered onto a single
* atlas canvas. The distribution of images on the canvas is
* managed with the bin packing algorithm described in:
* http://www.blackpawn.com/texts/lightmaps/
*
* @param {number} size The size in pixels of the sprite image.
* @param {number} space The space in pixels between images.
* Because texture coordinates are float values, the edges of
* images might not be completely correct (in a way that the
* edges overlap when being rendered). To avoid this we add a
* padding around each image.
*/
class Atlas {
/**
* This class facilitates the creation of image atlases.
*
* Images added to an atlas will be rendered onto a single
* atlas canvas. The distribution of images on the canvas is
* managed with the bin packing algorithm described in:
* http://www.blackpawn.com/texts/lightmaps/
*
* @param {number} size The size in pixels of the sprite image.
* @param {number} space The space in pixels between images.
* Because texture coordinates are float values, the edges of
+14 -12
View File
@@ -41,20 +41,22 @@ const INITIAL_ATLAS_SIZE = 256;
const MAX_ATLAS_SIZE = -1;
/**
* @classdesc
* Manages the creation of image atlases.
*
* Images added to this manager will be inserted into an atlas, which
* will be used for rendering.
* The `size` given in the constructor is the size for the first
* atlas. After that, when new atlases are created, they will have
* twice the size as the latest atlas (until `maxSize` is reached).
*
* If an application uses many images or very large images, it is recommended
* to set a higher `size` value to avoid the creation of too many atlases.
* @api
*/
class AtlasManager {
/**
* Manages the creation of image atlases.
*
* Images added to this manager will be inserted into an atlas, which
* will be used for rendering.
* The `size` given in the constructor is the size for the first
* atlas. After that, when new atlases are created, they will have
* twice the size as the latest atlas (until `maxSize` is reached).
*
* If an application uses many images or very large images, it is recommended
* to set a higher `size` value to avoid the creation of too many atlases.
*
* @api
* @param {module:ol/style/AtlasManager~Options=} opt_options Options.
*/
constructor(opt_options) {
+5 -4
View File
@@ -20,13 +20,14 @@ import RegularShape from '../style/RegularShape.js';
*/
/**
* @classdesc
* Set circle style for vector features.
* @api
*/
class CircleStyle extends RegularShape {
/**
* @classdesc
* Set circle style for vector features.
*
* @param {module:ol/style/Circle~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
+1 -1
View File
@@ -16,11 +16,11 @@ import {asString} from '../color.js';
/**
* @classdesc
* Set fill style for vector features.
* @api
*/
class Fill {
/**
* @param {module:ol/style/Fill~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
+5 -4
View File
@@ -52,13 +52,14 @@ import ImageStyle from '../style/Image.js';
*/
/**
* @classdesc
* Set icon style for vector features.
* @api
*/
class Icon extends ImageStyle {
/**
* @classdesc
* Set icon style for vector features.
*
* @param {module:ol/style/Icon~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
const options = opt_options || {};
+1
View File
@@ -4,6 +4,7 @@
import {asString} from '../color.js';
/**
* @classdesc
* Singleton class. Available through {@link module:ol/style/IconImageCache~shared}.
*/
class IconImageCache {
+1 -1
View File
@@ -18,11 +18,11 @@
* A base class used for creating subclasses and not instantiated in
* apps. Base class for {@link module:ol/style/Icon~Icon}, {@link module:ol/style/Circle~CircleStyle} and
* {@link module:ol/style/RegularShape~RegularShape}.
* @api
*/
class ImageStyle {
/**
* @param {module:ol/style/Image~Options} options Options.
* @api
*/
constructor(options) {
+7 -6
View File
@@ -46,15 +46,16 @@ import ImageStyle from '../style/Image.js';
*/
/**
* @classdesc
* Set regular shape style for vector features. The resulting shape will be
* a regular polygon when `radius` is provided, or a star when `radius1` and
* `radius2` are provided.
* @api
*/
class RegularShape extends ImageStyle {
/**
* @classdesc
* Set regular shape style for vector features. The resulting shape will be
* a regular polygon when `radius` is provided, or a star when `radius1` and
* `radius2` are provided.
*
* @param {module:ol/style/RegularShape~Options} options Options.
* @api
*/
constructor(options) {
/**
+1 -2
View File
@@ -26,12 +26,11 @@ import {getUid} from '../util.js';
* Note that the defaults given are the Canvas defaults, which will be used if
* option is not defined. The `get` functions return whatever was entered in
* the options; they will not return the default.
* @api
*/
class Stroke {
/**
* @param {module:ol/style/Stroke~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
+1 -2
View File
@@ -143,12 +143,11 @@ import Stroke from '../style/Stroke.js';
* Container for vector feature rendering styles. Any changes made to the style
* or its children through `set*()` methods will not take effect until the
* feature or layer that uses the style is re-rendered.
* @api
*/
class Style {
/**
* @param {module:ol/style/Style~Options=} opt_options Style options.
* @api
*/
constructor(opt_options) {
+1 -2
View File
@@ -48,12 +48,11 @@ const DEFAULT_FILL_COLOR = '#333';
/**
* @classdesc
* Set text style for vector features.
* @api
*/
class Text {
/**
* @param {module:ol/style/Text~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {