Module type for ol.style.*

This commit is contained in:
Frederic Junod
2018-03-27 15:04:07 +02:00
parent 2de83adb8e
commit 7cbc22fece
24 changed files with 184 additions and 184 deletions
+3 -3
View File
@@ -80,7 +80,7 @@ const AtlasManager = function(opt_options) {
/**
* @private
* @type {Array.<ol.style.Atlas>}
* @type {Array.<module:ol/style/Atlas~Atlas>}
*/
this.atlases_ = [new Atlas(this.currentSize_, this.space_)];
@@ -93,7 +93,7 @@ const AtlasManager = function(opt_options) {
/**
* @private
* @type {Array.<ol.style.Atlas>}
* @type {Array.<module:ol/style/Atlas~Atlas>}
*/
this.hitAtlases_ = [new Atlas(this.currentHitSize_, this.space_)];
};
@@ -119,7 +119,7 @@ AtlasManager.prototype.getInfo = function(id) {
/**
* @private
* @param {Array.<ol.style.Atlas>} atlases The atlases to search.
* @param {Array.<module:ol/style/Atlas~Atlas>} atlases The atlases to search.
* @param {string} id The identifier of the entry to check.
* @return {?module:ol/style/Atlas~AtlasInfo} The position and atlas image for the entry,
* or `null` if the entry is not part of the atlases.
+2 -2
View File
@@ -10,7 +10,7 @@ import RegularShape from '../style/RegularShape.js';
*
* @constructor
* @param {olx.style.CircleOptions=} opt_options Options.
* @extends {ol.style.RegularShape}
* @extends {module:ol/style/RegularShape~RegularShape}
* @api
*/
const CircleStyle = function(opt_options) {
@@ -33,7 +33,7 @@ inherits(CircleStyle, RegularShape);
/**
* Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too.
* @return {ol.style.Circle} The cloned style.
* @return {module:ol/style/Circle~CircleStyle} The cloned style.
* @override
* @api
*/
+1 -1
View File
@@ -32,7 +32,7 @@ const Fill = function(opt_options) {
/**
* Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}.
* @return {ol.style.Fill} The cloned style.
* @return {module:ol/style/Fill~Fill} The cloned style.
* @api
*/
Fill.prototype.clone = function() {
+7 -7
View File
@@ -18,7 +18,7 @@ import ImageStyle from '../style/Image.js';
*
* @constructor
* @param {olx.style.IconOptions=} opt_options Options.
* @extends {ol.style.Image}
* @extends {module:ol/style/Image~ImageStyle}
* @api
*/
const Icon = function(opt_options) {
@@ -39,21 +39,21 @@ const Icon = function(opt_options) {
/**
* @private
* @type {ol.style.IconOrigin}
* @type {module:ol/style/IconOrigin~IconOrigin}
*/
this.anchorOrigin_ = options.anchorOrigin !== undefined ?
options.anchorOrigin : IconOrigin.TOP_LEFT;
/**
* @private
* @type {ol.style.IconAnchorUnits}
* @type {module:ol/style/IconAnchorUnits~IconAnchorUnits}
*/
this.anchorXUnits_ = options.anchorXUnits !== undefined ?
options.anchorXUnits : IconAnchorUnits.FRACTION;
/**
* @private
* @type {ol.style.IconAnchorUnits}
* @type {module:ol/style/IconAnchorUnits~IconAnchorUnits}
*/
this.anchorYUnits_ = options.anchorYUnits !== undefined ?
options.anchorYUnits : IconAnchorUnits.FRACTION;
@@ -105,7 +105,7 @@ const Icon = function(opt_options) {
/**
* @private
* @type {ol.style.IconImage}
* @type {module:ol/style/IconImage~IconImage}
*/
this.iconImage_ = getIconImage(
image, /** @type {string} */ (src), imgSize, this.crossOrigin_, imageState, this.color_);
@@ -118,7 +118,7 @@ const Icon = function(opt_options) {
/**
* @private
* @type {ol.style.IconOrigin}
* @type {module:ol/style/IconOrigin~IconOrigin}
*/
this.offsetOrigin_ = options.offsetOrigin !== undefined ?
options.offsetOrigin : IconOrigin.TOP_LEFT;
@@ -177,7 +177,7 @@ inherits(Icon, ImageStyle);
/**
* Clones the style. The underlying Image/HTMLCanvasElement is not cloned.
* @return {ol.style.Icon} The cloned style.
* @return {module:ol/style/Icon~Icon} The cloned style.
* @api
*/
Icon.prototype.clone = function() {
+1 -1
View File
@@ -98,7 +98,7 @@ inherits(IconImage, EventTarget);
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/ImageState~ImageState} imageState Image state.
* @param {module:ol/color~Color} color Color.
* @return {ol.style.IconImage} Icon image.
* @return {module:ol/style/IconImage~IconImage} Icon image.
*/
export function get(image, src, size, crossOrigin, imageState, color) {
let iconImage = iconImageCache.get(src, crossOrigin, color);
+3 -3
View File
@@ -10,7 +10,7 @@ import {asString} from '../color.js';
const IconImageCache = function() {
/**
* @type {!Object.<string, ol.style.IconImage>}
* @type {!Object.<string, module:ol/style/IconImage~IconImage>}
* @private
*/
this.cache_ = {};
@@ -71,7 +71,7 @@ IconImageCache.prototype.expire = function() {
* @param {string} src Src.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/color~Color} color Color.
* @return {ol.style.IconImage} Icon image.
* @return {module:ol/style/IconImage~IconImage} Icon image.
*/
IconImageCache.prototype.get = function(src, crossOrigin, color) {
const key = getKey(src, crossOrigin, color);
@@ -83,7 +83,7 @@ IconImageCache.prototype.get = function(src, crossOrigin, color) {
* @param {string} src Src.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/color~Color} color Color.
* @param {ol.style.IconImage} iconImage Icon image.
* @param {module:ol/style/IconImage~IconImage} iconImage Icon image.
*/
IconImageCache.prototype.set = function(src, crossOrigin, color, iconImage) {
const key = getKey(src, crossOrigin, color);
+2 -2
View File
@@ -4,8 +4,8 @@
/**
* @classdesc
* A base class used for creating subclasses and not instantiated in
* apps. Base class for {@link ol.style.Icon}, {@link ol.style.Circle} and
* {@link ol.style.RegularShape}.
* apps. Base class for {@link module:ol/style/Icon~Icon}, {@link module:ol/style/Circle~CircleStyle} and
* {@link module:ol/style/RegularShape~RegularShape}.
*
* @constructor
* @abstract
+8 -8
View File
@@ -17,7 +17,7 @@ import ImageStyle from '../style/Image.js';
*
* @constructor
* @param {olx.style.RegularShapeOptions} options Options.
* @extends {ol.style.Image}
* @extends {module:ol/style/Image~ImageStyle}
* @api
*/
const RegularShape = function(options) {
@@ -41,7 +41,7 @@ const RegularShape = function(options) {
/**
* @private
* @type {ol.style.Fill}
* @type {module:ol/style/Fill~Fill}
*/
this.fill_ = options.fill !== undefined ? options.fill : null;
@@ -78,7 +78,7 @@ const RegularShape = function(options) {
/**
* @private
* @type {ol.style.Stroke}
* @type {module:ol/style/Stroke~Stroke}
*/
this.stroke_ = options.stroke !== undefined ? options.stroke : null;
@@ -108,7 +108,7 @@ const RegularShape = function(options) {
/**
* @protected
* @type {ol.style.AtlasManager|undefined}
* @type {module:ol/style/AtlasManager~AtlasManager|undefined}
*/
this.atlasManager_ = options.atlasManager;
@@ -140,7 +140,7 @@ inherits(RegularShape, ImageStyle);
/**
* Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too.
* @return {ol.style.RegularShape} The cloned style.
* @return {module:ol/style/RegularShape~RegularShape} The cloned style.
* @api
*/
RegularShape.prototype.clone = function() {
@@ -183,7 +183,7 @@ RegularShape.prototype.getAngle = function() {
/**
* Get the fill style for the shape.
* @return {ol.style.Fill} Fill style.
* @return {module:ol/style/Fill~Fill} Fill style.
* @api
*/
RegularShape.prototype.getFill = function() {
@@ -282,7 +282,7 @@ RegularShape.prototype.getSize = function() {
/**
* Get the stroke style for the shape.
* @return {ol.style.Stroke} Stroke style.
* @return {module:ol/style/Stroke~Stroke} Stroke style.
* @api
*/
RegularShape.prototype.getStroke = function() {
@@ -310,7 +310,7 @@ RegularShape.prototype.unlistenImageChange = function(listener, thisArg) {};
/**
* @protected
* @param {ol.style.AtlasManager|undefined} atlasManager An atlas manager.
* @param {module:ol/style/AtlasManager~AtlasManager|undefined} atlasManager An atlas manager.
*/
RegularShape.prototype.render_ = function(atlasManager) {
let imageSize;
+1 -1
View File
@@ -70,7 +70,7 @@ const Stroke = function(opt_options) {
/**
* Clones the style.
* @return {ol.style.Stroke} The cloned style.
* @return {module:ol/style/Stroke~Stroke} The cloned style.
* @api
*/
Stroke.prototype.clone = function() {
+22 -22
View File
@@ -40,13 +40,13 @@ const Style = function(opt_options) {
/**
* @private
* @type {ol.style.Fill}
* @type {module:ol/style/Fill~Fill}
*/
this.fill_ = options.fill !== undefined ? options.fill : null;
/**
* @private
* @type {ol.style.Image}
* @type {module:ol/style/Image~ImageStyle}
*/
this.image_ = options.image !== undefined ? options.image : null;
@@ -58,13 +58,13 @@ const Style = function(opt_options) {
/**
* @private
* @type {ol.style.Stroke}
* @type {module:ol/style/Stroke~Stroke}
*/
this.stroke_ = options.stroke !== undefined ? options.stroke : null;
/**
* @private
* @type {ol.style.Text}
* @type {module:ol/style/Text~Text}
*/
this.text_ = options.text !== undefined ? options.text : null;
@@ -79,7 +79,7 @@ const Style = function(opt_options) {
/**
* Clones the style.
* @return {ol.style.Style} The cloned style.
* @return {module:ol/style/Style~Style} The cloned style.
* @api
*/
Style.prototype.clone = function() {
@@ -145,7 +145,7 @@ Style.prototype.getGeometryFunction = function() {
/**
* Get the fill style.
* @return {ol.style.Fill} Fill style.
* @return {module:ol/style/Fill~Fill} Fill style.
* @api
*/
Style.prototype.getFill = function() {
@@ -155,7 +155,7 @@ Style.prototype.getFill = function() {
/**
* Set the fill style.
* @param {ol.style.Fill} fill Fill style.
* @param {module:ol/style/Fill~Fill} fill Fill style.
* @api
*/
Style.prototype.setFill = function(fill) {
@@ -165,7 +165,7 @@ Style.prototype.setFill = function(fill) {
/**
* Get the image style.
* @return {ol.style.Image} Image style.
* @return {module:ol/style/Image~ImageStyle} Image style.
* @api
*/
Style.prototype.getImage = function() {
@@ -175,7 +175,7 @@ Style.prototype.getImage = function() {
/**
* Set the image style.
* @param {ol.style.Image} image Image style.
* @param {module:ol/style/Image~ImageStyle} image Image style.
* @api
*/
Style.prototype.setImage = function(image) {
@@ -185,7 +185,7 @@ Style.prototype.setImage = function(image) {
/**
* Get the stroke style.
* @return {ol.style.Stroke} Stroke style.
* @return {module:ol/style/Stroke~Stroke} Stroke style.
* @api
*/
Style.prototype.getStroke = function() {
@@ -195,7 +195,7 @@ Style.prototype.getStroke = function() {
/**
* Set the stroke style.
* @param {ol.style.Stroke} stroke Stroke style.
* @param {module:ol/style/Stroke~Stroke} stroke Stroke style.
* @api
*/
Style.prototype.setStroke = function(stroke) {
@@ -205,7 +205,7 @@ Style.prototype.setStroke = function(stroke) {
/**
* Get the text style.
* @return {ol.style.Text} Text style.
* @return {module:ol/style/Text~Text} Text style.
* @api
*/
Style.prototype.getText = function() {
@@ -215,7 +215,7 @@ Style.prototype.getText = function() {
/**
* Set the text style.
* @param {ol.style.Text} text Text style.
* @param {module:ol/style/Text~Text} text Text style.
* @api
*/
Style.prototype.setText = function(text) {
@@ -272,9 +272,9 @@ Style.prototype.setZIndex = function(zIndex) {
/**
* Convert the provided object into a style function. Functions passed through
* unchanged. Arrays of ol.style.Style or single style objects wrapped in a
* unchanged. Arrays of module:ol/style/Style~Style or single style objects wrapped in a
* new style function.
* @param {module:ol/style~StyleFunction|Array.<ol.style.Style>|ol.style.Style} obj
* @param {module:ol/style~StyleFunction|Array.<module:ol/style/Style~Style>|module:ol/style/Style~Style} obj
* A style function, a single style, or an array of styles.
* @return {module:ol/style~StyleFunction} A style function.
*/
@@ -285,14 +285,14 @@ export function toFunction(obj) {
styleFunction = obj;
} else {
/**
* @type {Array.<ol.style.Style>}
* @type {Array.<module:ol/style/Style~Style>}
*/
let styles;
if (Array.isArray(obj)) {
styles = obj;
} else {
assert(obj instanceof Style,
41); // Expected an `ol.style.Style` or an array of `ol.style.Style`
41); // Expected an `module:ol/style/Style~Style` or an array of `module:ol/style/Style~Style`
styles = [obj];
}
styleFunction = function() {
@@ -304,7 +304,7 @@ export function toFunction(obj) {
/**
* @type {Array.<ol.style.Style>}
* @type {Array.<module:ol/style/Style~Style>}
*/
let defaultStyles = null;
@@ -312,12 +312,12 @@ let defaultStyles = null;
/**
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
* @param {number} resolution Resolution.
* @return {Array.<ol.style.Style>} Style.
* @return {Array.<module:ol/style/Style~Style>} Style.
*/
export function createDefaultStyle(feature, resolution) {
// We don't use an immediately-invoked function
// and a closure so we don't get an error at script evaluation time in
// browsers that do not support Canvas. (ol.style.Circle does
// browsers that do not support Canvas. (module:ol/style/Circle~CircleStyle does
// canvas.getContext('2d') at construction time, which will cause an.error
// in such browsers.)
if (!defaultStyles) {
@@ -346,10 +346,10 @@ export function createDefaultStyle(feature, resolution) {
/**
* Default styles for editing features.
* @return {Object.<module:ol/geom/GeometryType~GeometryType, Array.<ol.style.Style>>} Styles
* @return {Object.<module:ol/geom/GeometryType~GeometryType, Array.<module:ol/style/Style~Style>>} Styles
*/
export function createEditingStyle() {
/** @type {Object.<module:ol/geom/GeometryType~GeometryType, Array.<ol.style.Style>>} */
/** @type {Object.<module:ol/geom/GeometryType~GeometryType, Array.<module:ol/style/Style~Style>>} */
const styles = {};
const white = [255, 255, 255, 1];
const blue = [0, 153, 255, 1];
+16 -16
View File
@@ -70,7 +70,7 @@ const Text = function(opt_options) {
/**
* @private
* @type {ol.style.Fill}
* @type {module:ol/style/Fill~Fill}
*/
this.fill_ = options.fill !== undefined ? options.fill :
new Fill({color: DEFAULT_FILL_COLOR});
@@ -83,7 +83,7 @@ const Text = function(opt_options) {
/**
* @private
* @type {ol.style.TextPlacement|string}
* @type {module:ol/style/Text~TextPlacement|string}
*/
this.placement_ = options.placement !== undefined ? options.placement : TextPlacement.POINT;
@@ -95,7 +95,7 @@ const Text = function(opt_options) {
/**
* @private
* @type {ol.style.Stroke}
* @type {module:ol/style/Stroke~Stroke}
*/
this.stroke_ = options.stroke !== undefined ? options.stroke : null;
@@ -113,13 +113,13 @@ const Text = function(opt_options) {
/**
* @private
* @type {ol.style.Fill}
* @type {module:ol/style/Fill~Fill}
*/
this.backgroundFill_ = options.backgroundFill ? options.backgroundFill : null;
/**
* @private
* @type {ol.style.Stroke}
* @type {module:ol/style/Stroke~Stroke}
*/
this.backgroundStroke_ = options.backgroundStroke ? options.backgroundStroke : null;
@@ -133,7 +133,7 @@ const Text = function(opt_options) {
/**
* Clones the style.
* @return {ol.style.Text} The cloned style.
* @return {module:ol/style/Text~Text} The cloned style.
* @api
*/
Text.prototype.clone = function() {
@@ -190,7 +190,7 @@ Text.prototype.getMaxAngle = function() {
/**
* Get the label placement.
* @return {ol.style.TextPlacement|string} Text placement.
* @return {module:ol/style/Text~TextPlacement|string} Text placement.
* @api
*/
Text.prototype.getPlacement = function() {
@@ -220,7 +220,7 @@ Text.prototype.getOffsetY = function() {
/**
* Get the fill style for the text.
* @return {ol.style.Fill} Fill style.
* @return {module:ol/style/Fill~Fill} Fill style.
* @api
*/
Text.prototype.getFill = function() {
@@ -260,7 +260,7 @@ Text.prototype.getScale = function() {
/**
* Get the stroke style for the text.
* @return {ol.style.Stroke} Stroke style.
* @return {module:ol/style/Stroke~Stroke} Stroke style.
* @api
*/
Text.prototype.getStroke = function() {
@@ -300,7 +300,7 @@ Text.prototype.getTextBaseline = function() {
/**
* Get the background fill style for the text.
* @return {ol.style.Fill} Fill style.
* @return {module:ol/style/Fill~Fill} Fill style.
* @api
*/
Text.prototype.getBackgroundFill = function() {
@@ -310,7 +310,7 @@ Text.prototype.getBackgroundFill = function() {
/**
* Get the background stroke style for the text.
* @return {ol.style.Stroke} Stroke style.
* @return {module:ol/style/Stroke~Stroke} Stroke style.
* @api
*/
Text.prototype.getBackgroundStroke = function() {
@@ -386,7 +386,7 @@ Text.prototype.setOffsetY = function(offsetY) {
/**
* Set the text placement.
*
* @param {ol.style.TextPlacement|string} placement Placement.
* @param {module:ol/style/Text~TextPlacement|string} placement Placement.
* @api
*/
Text.prototype.setPlacement = function(placement) {
@@ -397,7 +397,7 @@ Text.prototype.setPlacement = function(placement) {
/**
* Set the fill.
*
* @param {ol.style.Fill} fill Fill style.
* @param {module:ol/style/Fill~Fill} fill Fill style.
* @api
*/
Text.prototype.setFill = function(fill) {
@@ -430,7 +430,7 @@ Text.prototype.setScale = function(scale) {
/**
* Set the stroke.
*
* @param {ol.style.Stroke} stroke Stroke style.
* @param {module:ol/style/Stroke~Stroke} stroke Stroke style.
* @api
*/
Text.prototype.setStroke = function(stroke) {
@@ -474,7 +474,7 @@ Text.prototype.setTextBaseline = function(textBaseline) {
/**
* Set the background fill.
*
* @param {ol.style.Fill} fill Fill style.
* @param {module:ol/style/Fill~Fill} fill Fill style.
* @api
*/
Text.prototype.setBackgroundFill = function(fill) {
@@ -485,7 +485,7 @@ Text.prototype.setBackgroundFill = function(fill) {
/**
* Set the background stroke.
*
* @param {ol.style.Stroke} stroke Stroke style.
* @param {module:ol/style/Stroke~Stroke} stroke Stroke style.
* @api
*/
Text.prototype.setBackgroundStroke = function(stroke) {