From 9bfdf818e4771ea4073fcd44bbcb8e32917e8aa8 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Fri, 27 Apr 2018 07:23:42 +0200 Subject: [PATCH] Rename Style~Function path type to Style~StyleFunction --- src/ol/Feature.js | 14 +++++++------- src/ol/format/KML.js | 2 +- src/ol/interaction/Draw.js | 4 ++-- src/ol/interaction/Extent.js | 8 ++++---- src/ol/interaction/Modify.js | 4 ++-- src/ol/interaction/Select.js | 4 ++-- src/ol/layer/Vector.js | 12 ++++++------ src/ol/layer/VectorTile.js | 4 ++-- src/ol/style/Style.js | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/ol/Feature.js b/src/ol/Feature.js index e4fb3529d0..34f386dbb6 100644 --- a/src/ol/Feature.js +++ b/src/ol/Feature.js @@ -78,13 +78,13 @@ const Feature = function(opt_geometryOrProperties) { /** * User provided style. * @private - * @type {module:ol/style/Style|Array.|module:ol/style/Style~Function} + * @type {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} */ this.style_ = null; /** * @private - * @type {module:ol/style/Style~Function|undefined} + * @type {module:ol/style/Style~StyleFunction|undefined} */ this.styleFunction_ = undefined; @@ -177,7 +177,7 @@ Feature.prototype.getGeometryName = function() { /** * Get the feature's style. Will return what was provided to the * {@link module:ol/Feature~Feature#setStyle} method. - * @return {module:ol/style/Style|Array.|module:ol/style/Style~Function} The feature style. + * @return {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} The feature style. * @api */ Feature.prototype.getStyle = function() { @@ -187,7 +187,7 @@ Feature.prototype.getStyle = function() { /** * Get the feature's style function. - * @return {module:ol/style/Style~Function|undefined} Return a function + * @return {module:ol/style/Style~StyleFunction|undefined} Return a function * representing the current style of this feature. * @api */ @@ -237,7 +237,7 @@ Feature.prototype.setGeometry = function(geometry) { * Set the style for the feature. This can be a single style object, an array * of styles, or a function that takes a resolution and returns an array of * styles. If it is `null` the feature has no style (a `null` style). - * @param {module:ol/style/Style|Array.|module:ol/style/Style~Function} style Style for this feature. + * @param {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} style Style for this feature. * @api * @fires module:ol/events/Event~Event#event:change */ @@ -286,9 +286,9 @@ Feature.prototype.setGeometryName = function(name) { * Convert the provided object into a feature style function. Functions passed * through unchanged. Arrays of module:ol/style/Style or single style objects wrapped * in a new feature style function. - * @param {module:ol/style/Style~Function|!Array.|!module:ol/style/Style} obj + * @param {module:ol/style/Style~StyleFunction|!Array.|!module:ol/style/Style} obj * A feature style function, a single style, or an array of styles. - * @return {module:ol/style/Style~Function} A style function. + * @return {module:ol/style/Style~StyleFunction} A style function. */ export function createStyleFunction(obj) { if (typeof obj === 'function') { diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 4fe40b4aca..1c106cb2ee 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -411,7 +411,7 @@ function createNameStyleFunction(foundStyle, name) { * @param {Array.} defaultStyle Default style. * @param {!Object.|string)>} sharedStyles Shared styles. * @param {boolean|undefined} showPointNames true to show names for point placemarks. - * @return {module:ol/style/Style~Function} Feature style function. + * @return {module:ol/style/Style~StyleFunction} Feature style function. */ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles, showPointNames) { diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index 8e496810a7..c10e1b0ca2 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -57,7 +57,7 @@ import {createEditingStyle} from '../style/Style.js'; * @property {module:ol/events/condition~Condition} [finishCondition] A function * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a * boolean to indicate whether the drawing can be finished. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [style] + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [style] * Style for sketch features. * @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction] * Function that is called when a geometry's coordinates are updated. @@ -437,7 +437,7 @@ inherits(Draw, PointerInteraction); /** - * @return {module:ol/style/Style~Function} Styles. + * @return {module:ol/style/Style~StyleFunction} Styles. */ function getDefaultStyleFunction() { const styles = createEditingStyle(); diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index c4863a50f3..0d4415bdc1 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -21,12 +21,12 @@ import {createEditingStyle} from '../style/Style.js'; * @typedef {Object} Options * @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no * initial extent. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [boxStyle] + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [boxStyle] * Style for the drawn extent box. Defaults to * {@link module:ol/style/Style~createEditing()['Polygon']} * @property {number} [pixelTolerance=10] Pixel tolerance for considering the * pointer close enough to a segment or vertex for editing. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [pointerStyle] + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [pointerStyle] * Style for the cursor used to draw the extent. Defaults to * {@link module:ol/style/Style~createEditing()['Point']} * @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps @@ -288,7 +288,7 @@ function handleUpEvent(mapBrowserEvent) { /** * Returns the default style for the drawn bbox * - * @return {module:ol/style/Style~Function} Default Extent style + * @return {module:ol/style/Style~StyleFunction} Default Extent style */ function getDefaultExtentStyleFunction() { const style = createEditingStyle(); @@ -300,7 +300,7 @@ function getDefaultExtentStyleFunction() { /** * Returns the default style for the pointer * - * @return {module:ol/style/Style~Function} Default pointer style + * @return {module:ol/style/Style~StyleFunction} Default pointer style */ function getDefaultPointerStyleFunction() { const style = createEditingStyle(); diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index ac89060e9b..6ae14aa33f 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -72,7 +72,7 @@ const ModifyEventType = { * features. Default is {@link module:ol/events/condition~always}. * @property {number} [pixelTolerance=10] Pixel tolerance for considering the * pointer close enough to a segment or vertex for editing. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [style] + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [style] * Style used for the features being modified. By default the default edit * style is used (see {@link module:ol/style}). * @property {module:ol/source/Vector} [source] The vector source with @@ -1267,7 +1267,7 @@ Modify.prototype.updateSegmentIndices_ = function( /** - * @return {module:ol/style/Style~Function} Styles. + * @return {module:ol/style/Style~StyleFunction} Styles. */ function getDefaultStyleFunction() { const style = createEditingStyle(); diff --git a/src/ol/interaction/Select.js b/src/ol/interaction/Select.js index 0476b6b245..5856157184 100644 --- a/src/ol/interaction/Select.js +++ b/src/ol/interaction/Select.js @@ -61,7 +61,7 @@ const SelectEventType = { * in the map and should return `true` for layers that you want to be * selectable. If the option is absent, all visible layers will be considered * selectable. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [style] + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [style] * Style for the selected features. By default the default edit style is used * (see {@link module:ol/style}). * @property {module:ol/events/condition~Condition} [removeCondition] A function @@ -441,7 +441,7 @@ Select.prototype.setMap = function(map) { /** - * @return {module:ol/style/Style~Function} Styles. + * @return {module:ol/style/Style~StyleFunction} Styles. */ function getDefaultStyleFunction() { const styles = createEditingStyle(); diff --git a/src/ol/layer/Vector.js b/src/ol/layer/Vector.js index 724ec6438b..e10b2fdc22 100644 --- a/src/ol/layer/Vector.js +++ b/src/ol/layer/Vector.js @@ -40,7 +40,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style. * @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all * image and text styles, and the priority is defined by the z-index of the style. Lower z-index * means higher priority. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [style] Layer style. See + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [style] Layer style. See * {@link ol.style} for default style which will be used if this is not defined. * @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously. * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be @@ -117,14 +117,14 @@ const VectorLayer = function(opt_options) { /** * User provided style. - * @type {module:ol/style/Style|Array.|module:ol/style/Style~Function} + * @type {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} * @private */ this.style_ = null; /** * Style function for use within the library. - * @type {module:ol/style/Style~Function|undefined} + * @type {module:ol/style/Style~StyleFunction|undefined} * @private */ this.styleFunction_ = undefined; @@ -210,7 +210,7 @@ VectorLayer.prototype.getSource; /** * Get the style for features. This returns whatever was passed to the `style` * option at construction or to the `setStyle` method. - * @return {module:ol/style/Style|Array.|module:ol/style/Style~Function} + * @return {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} * Layer style. * @api */ @@ -221,7 +221,7 @@ VectorLayer.prototype.getStyle = function() { /** * Get the style function. - * @return {module:ol/style/Style~Function|undefined} Layer style function. + * @return {module:ol/style/Style~StyleFunction|undefined} Layer style function. * @api */ VectorLayer.prototype.getStyleFunction = function() { @@ -263,7 +263,7 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) { * it is `null` the layer has no style (a `null` style), so only features * that have their own styles will be rendered in the layer. See * {@link ol.style} for information on the default style. - * @param {module:ol/style/Style|Array.|module:ol/style/Style~Function|null|undefined} + * @param {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction|null|undefined} * style Layer style. * @api */ diff --git a/src/ol/layer/VectorTile.js b/src/ol/layer/VectorTile.js index dd6a725946..0adf5100c6 100644 --- a/src/ol/layer/VectorTile.js +++ b/src/ol/layer/VectorTile.js @@ -69,7 +69,7 @@ export const RenderType = { * image and text styles, and the priority is defined by the z-index of the style. Lower z-index * means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with * `'hybrid'`. - * @property {module:ol/style/Style|Array.|module:ol/style/Style~Function} [style] Layer style. See + * @property {module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction} [style] Layer style. See * {@link ol.style} for default style which will be used if this is not defined. * @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously. * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be @@ -82,7 +82,7 @@ export const RenderType = { * means no preloading. * @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting * features before rendering. By default features are drawn in the order that they are created. - * @property {(module:ol/style/Style|Array.|module:ol/style/Style~Function)} [style] Layer style. See + * @property {(module:ol/style/Style|Array.|module:ol/style/Style~StyleFunction)} [style] Layer style. See * {@link ol.style} for default style which will be used if this is not defined. * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error. */ diff --git a/src/ol/style/Style.js b/src/ol/style/Style.js index 154f468290..fe1e3557f0 100644 --- a/src/ol/style/Style.js +++ b/src/ol/style/Style.js @@ -15,7 +15,7 @@ import Stroke from '../style/Stroke.js'; * vector layer can be styled. * * @typedef {function((module:ol/Feature|module:ol/render/Feature), number): - * (module:ol/style/Style|Array.)} Function + * (module:ol/style/Style|Array.)} StyleFunction */ @@ -324,9 +324,9 @@ Style.prototype.setZIndex = function(zIndex) { * Convert the provided object into a style function. Functions passed through * unchanged. Arrays of module:ol/style/Style or single style objects wrapped in a * new style function. - * @param {module:ol/style/Style~Function|Array.|module:ol/style/Style} obj + * @param {module:ol/style/Style~StyleFunction|Array.|module:ol/style/Style} obj * A style function, a single style, or an array of styles. - * @return {module:ol/style/Style~Function} A style function. + * @return {module:ol/style/Style~StyleFunction} A style function. */ export function toFunction(obj) { let styleFunction;