Module type for ol.Color
This commit is contained in:
@@ -35,7 +35,7 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
let DEFAULT_COLOR;
|
||||
|
||||
@@ -477,7 +477,7 @@ function findStyle(styleValue, defaultStyle, sharedStyles) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {ol.Color|undefined} Color.
|
||||
* @return {module:ol/color~Color|undefined} Color.
|
||||
*/
|
||||
function readColor(node) {
|
||||
const s = getAllTextContent(node, false);
|
||||
@@ -746,7 +746,7 @@ function labelStyleParser(node, objectStack) {
|
||||
const styleObject = objectStack[objectStack.length - 1];
|
||||
const textStyle = new Text({
|
||||
fill: new Fill({
|
||||
color: /** @type {ol.Color} */
|
||||
color: /** @type {module:ol/color~Color} */
|
||||
('color' in object ? object['color'] : DEFAULT_COLOR)
|
||||
}),
|
||||
scale: /** @type {number|undefined} */
|
||||
@@ -784,7 +784,7 @@ function lineStyleParser(node, objectStack) {
|
||||
}
|
||||
const styleObject = objectStack[objectStack.length - 1];
|
||||
const strokeStyle = new Stroke({
|
||||
color: /** @type {ol.Color} */
|
||||
color: /** @type {module:ol/color~Color} */
|
||||
('color' in object ? object['color'] : DEFAULT_COLOR),
|
||||
width: /** @type {number} */ ('width' in object ? object['width'] : 1)
|
||||
});
|
||||
@@ -817,7 +817,7 @@ function polyStyleParser(node, objectStack) {
|
||||
}
|
||||
const styleObject = objectStack[objectStack.length - 1];
|
||||
const fillStyle = new Fill({
|
||||
color: /** @type {ol.Color} */
|
||||
color: /** @type {module:ol/color~Color} */
|
||||
('color' in object ? object['color'] : DEFAULT_COLOR)
|
||||
});
|
||||
styleObject['fillStyle'] = fillStyle;
|
||||
@@ -2067,7 +2067,7 @@ KML.prototype.readProjection;
|
||||
|
||||
/**
|
||||
* @param {Node} node Node to append a TextNode with the color to.
|
||||
* @param {ol.Color|string} color Color.
|
||||
* @param {module:ol/color~Color|string} color Color.
|
||||
*/
|
||||
function writeColorTextNode(node, color) {
|
||||
const rgba = asArray(color);
|
||||
|
||||
@@ -17,7 +17,7 @@ export const defaultFont = '10px sans-serif';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
export const defaultFillStyle = [0, 0, 0, 1];
|
||||
|
||||
@@ -59,7 +59,7 @@ export const defaultMiterLimit = 10;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
export const defaultStrokeStyle = [0, 0, 0, 1];
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export const DEFAULT_FONT = '10px sans-serif';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
export const DEFAULT_FILLSTYLE = [0.0, 0.0, 0.0, 1.0];
|
||||
|
||||
@@ -53,7 +53,7 @@ export const DEFAULT_MITERLIMIT = 10;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
export const DEFAULT_STROKESTYLE = [0.0, 0.0, 0.0, 1.0];
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const Fill = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Color|module:ol/colorlike~ColorLike}
|
||||
* @type {module:ol/color~Color|module:ol/colorlike~ColorLike}
|
||||
*/
|
||||
this.color_ = options.color !== undefined ? options.color : null;
|
||||
|
||||
@@ -45,7 +45,7 @@ Fill.prototype.clone = function() {
|
||||
|
||||
/**
|
||||
* Get the fill color.
|
||||
* @return {ol.Color|module:ol/colorlike~ColorLike} Color.
|
||||
* @return {module:ol/color~Color|module:ol/colorlike~ColorLike} Color.
|
||||
* @api
|
||||
*/
|
||||
Fill.prototype.getColor = function() {
|
||||
@@ -56,7 +56,7 @@ Fill.prototype.getColor = function() {
|
||||
/**
|
||||
* Set the color.
|
||||
*
|
||||
* @param {ol.Color|module:ol/colorlike~ColorLike} color Color.
|
||||
* @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color.
|
||||
* @api
|
||||
*/
|
||||
Fill.prototype.setColor = function(color) {
|
||||
|
||||
@@ -99,7 +99,7 @@ const Icon = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
this.color_ = options.color !== undefined ? asArray(options.color) : null;
|
||||
|
||||
@@ -248,7 +248,7 @@ Icon.prototype.getAnchor = function() {
|
||||
|
||||
/**
|
||||
* Get the icon color.
|
||||
* @return {ol.Color} Color.
|
||||
* @return {module:ol/color~Color} Color.
|
||||
* @api
|
||||
*/
|
||||
Icon.prototype.getColor = function() {
|
||||
|
||||
@@ -16,7 +16,7 @@ import {iconImageCache} from '../style.js';
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.ImageState} imageState Image state.
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @extends {module:ol/events/EventTarget~EventTarget}
|
||||
*/
|
||||
const IconImage = function(image, src, size, crossOrigin, imageState, color) {
|
||||
@@ -49,7 +49,7 @@ const IconImage = function(image, src, size, crossOrigin, imageState, color) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Color}
|
||||
* @type {module:ol/color~Color}
|
||||
*/
|
||||
this.color_ = color;
|
||||
|
||||
@@ -97,7 +97,7 @@ inherits(IconImage, EventTarget);
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.ImageState} imageState Image state.
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @return {ol.style.IconImage} Icon image.
|
||||
*/
|
||||
export function get(image, src, size, crossOrigin, imageState, color) {
|
||||
|
||||
@@ -32,7 +32,7 @@ const IconImageCache = function() {
|
||||
/**
|
||||
* @param {string} src Src.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @return {string} Cache key.
|
||||
*/
|
||||
function getKey(src, crossOrigin, color) {
|
||||
@@ -70,7 +70,7 @@ IconImageCache.prototype.expire = function() {
|
||||
/**
|
||||
* @param {string} src Src.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @return {ol.style.IconImage} Icon image.
|
||||
*/
|
||||
IconImageCache.prototype.get = function(src, crossOrigin, color) {
|
||||
@@ -82,7 +82,7 @@ IconImageCache.prototype.get = function(src, crossOrigin, color) {
|
||||
/**
|
||||
* @param {string} src Src.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @param {ol.style.IconImage} iconImage Icon image.
|
||||
*/
|
||||
IconImageCache.prototype.set = function(src, crossOrigin, color, iconImage) {
|
||||
|
||||
@@ -20,7 +20,7 @@ const Stroke = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Color|module:ol/colorlike~ColorLike}
|
||||
* @type {module:ol/color~Color|module:ol/colorlike~ColorLike}
|
||||
*/
|
||||
this.color_ = options.color !== undefined ? options.color : null;
|
||||
|
||||
@@ -89,7 +89,7 @@ Stroke.prototype.clone = function() {
|
||||
|
||||
/**
|
||||
* Get the stroke color.
|
||||
* @return {ol.Color|module:ol/colorlike~ColorLike} Color.
|
||||
* @return {module:ol/color~Color|module:ol/colorlike~ColorLike} Color.
|
||||
* @api
|
||||
*/
|
||||
Stroke.prototype.getColor = function() {
|
||||
@@ -160,7 +160,7 @@ Stroke.prototype.getWidth = function() {
|
||||
/**
|
||||
* Set the color.
|
||||
*
|
||||
* @param {ol.Color|module:ol/colorlike~ColorLike} color Color.
|
||||
* @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color.
|
||||
* @api
|
||||
*/
|
||||
Stroke.prototype.setColor = function(color) {
|
||||
|
||||
Reference in New Issue
Block a user