Rename Style~Function path type to Style~StyleFunction

This commit is contained in:
ahocevar
2018-04-27 07:23:42 +02:00
parent 3a365fab56
commit 9bfdf818e4
9 changed files with 29 additions and 29 deletions

View File

@@ -78,13 +78,13 @@ const Feature = function(opt_geometryOrProperties) {
/** /**
* User provided style. * User provided style.
* @private * @private
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} * @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
*/ */
this.style_ = null; this.style_ = null;
/** /**
* @private * @private
* @type {module:ol/style/Style~Function|undefined} * @type {module:ol/style/Style~StyleFunction|undefined}
*/ */
this.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 * Get the feature's style. Will return what was provided to the
* {@link module:ol/Feature~Feature#setStyle} method. * {@link module:ol/Feature~Feature#setStyle} method.
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} The feature style. * @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
* @api * @api
*/ */
Feature.prototype.getStyle = function() { Feature.prototype.getStyle = function() {
@@ -187,7 +187,7 @@ Feature.prototype.getStyle = function() {
/** /**
* Get the feature's style 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. * representing the current style of this feature.
* @api * @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 * 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 * 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). * styles. If it is `null` the feature has no style (a `null` style).
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} style Style for this feature. * @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
* @api * @api
* @fires module:ol/events/Event~Event#event:change * @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 * Convert the provided object into a feature style function. Functions passed
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped * through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
* in a new feature style function. * in a new feature style function.
* @param {module:ol/style/Style~Function|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj * @param {module:ol/style/Style~StyleFunction|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
* A feature style function, a single style, or an array of styles. * 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) { export function createStyleFunction(obj) {
if (typeof obj === 'function') { if (typeof obj === 'function') {

View File

@@ -411,7 +411,7 @@ function createNameStyleFunction(foundStyle, name) {
* @param {Array.<module:ol/style/Style>} defaultStyle Default style. * @param {Array.<module:ol/style/Style>} defaultStyle Default style.
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles Shared styles. * @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles Shared styles.
* @param {boolean|undefined} showPointNames true to show names for point placemarks. * @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) { function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles, showPointNames) {

View File

@@ -57,7 +57,7 @@ import {createEditingStyle} from '../style/Style.js';
* @property {module:ol/events/condition~Condition} [finishCondition] A function * @property {module:ol/events/condition~Condition} [finishCondition] A function
* that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
* boolean to indicate whether the drawing can be finished. * boolean to indicate whether the drawing can be finished.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style for sketch features. * Style for sketch features.
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction] * @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
* Function that is called when a geometry's coordinates are updated. * 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() { function getDefaultStyleFunction() {
const styles = createEditingStyle(); const styles = createEditingStyle();

View File

@@ -21,12 +21,12 @@ import {createEditingStyle} from '../style/Style.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no * @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
* initial extent. * initial extent.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [boxStyle] * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
* Style for the drawn extent box. Defaults to * Style for the drawn extent box. Defaults to
* {@link module:ol/style/Style~createEditing()['Polygon']} * {@link module:ol/style/Style~createEditing()['Polygon']}
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the * @property {number} [pixelTolerance=10] Pixel tolerance for considering the
* pointer close enough to a segment or vertex for editing. * pointer close enough to a segment or vertex for editing.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [pointerStyle] * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
* Style for the cursor used to draw the extent. Defaults to * Style for the cursor used to draw the extent. Defaults to
* {@link module:ol/style/Style~createEditing()['Point']} * {@link module:ol/style/Style~createEditing()['Point']}
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps * @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 * 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() { function getDefaultExtentStyleFunction() {
const style = createEditingStyle(); const style = createEditingStyle();
@@ -300,7 +300,7 @@ function getDefaultExtentStyleFunction() {
/** /**
* Returns the default style for the pointer * 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() { function getDefaultPointerStyleFunction() {
const style = createEditingStyle(); const style = createEditingStyle();

View File

@@ -72,7 +72,7 @@ const ModifyEventType = {
* features. Default is {@link module:ol/events/condition~always}. * features. Default is {@link module:ol/events/condition~always}.
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the * @property {number} [pixelTolerance=10] Pixel tolerance for considering the
* pointer close enough to a segment or vertex for editing. * pointer close enough to a segment or vertex for editing.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style used for the features being modified. By default the default edit * Style used for the features being modified. By default the default edit
* style is used (see {@link module:ol/style}). * style is used (see {@link module:ol/style}).
* @property {module:ol/source/Vector} [source] The vector source with * @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() { function getDefaultStyleFunction() {
const style = createEditingStyle(); const style = createEditingStyle();

View File

@@ -61,7 +61,7 @@ const SelectEventType = {
* in the map and should return `true` for layers that you want to be * 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. If the option is absent, all visible layers will be considered
* selectable. * selectable.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
* Style for the selected features. By default the default edit style is used * Style for the selected features. By default the default edit style is used
* (see {@link module:ol/style}). * (see {@link module:ol/style}).
* @property {module:ol/events/condition~Condition} [removeCondition] A function * @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() { function getDefaultStyleFunction() {
const styles = createEditingStyle(); const styles = createEditingStyle();

View File

@@ -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 * @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 * image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority. * means higher priority.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] Layer style. See * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined. * {@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 {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
@@ -117,14 +117,14 @@ const VectorLayer = function(opt_options) {
/** /**
* User provided style. * User provided style.
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} * @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
* @private * @private
*/ */
this.style_ = null; this.style_ = null;
/** /**
* Style function for use within the library. * Style function for use within the library.
* @type {module:ol/style/Style~Function|undefined} * @type {module:ol/style/Style~StyleFunction|undefined}
* @private * @private
*/ */
this.styleFunction_ = undefined; this.styleFunction_ = undefined;
@@ -210,7 +210,7 @@ VectorLayer.prototype.getSource;
/** /**
* Get the style for features. This returns whatever was passed to the `style` * Get the style for features. This returns whatever was passed to the `style`
* option at construction or to the `setStyle` method. * option at construction or to the `setStyle` method.
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} * @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
* Layer style. * Layer style.
* @api * @api
*/ */
@@ -221,7 +221,7 @@ VectorLayer.prototype.getStyle = function() {
/** /**
* Get the style 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 * @api
*/ */
VectorLayer.prototype.getStyleFunction = function() { 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 * 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 * that have their own styles will be rendered in the layer. See
* {@link ol.style} for information on the default style. * {@link ol.style} for information on the default style.
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function|null|undefined} * @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined}
* style Layer style. * style Layer style.
* @api * @api
*/ */

View File

@@ -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 * 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 * means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
* `'hybrid'`. * `'hybrid'`.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style] Layer style. See * @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined. * {@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 {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
@@ -82,7 +82,7 @@ export const RenderType = {
* means no preloading. * means no preloading.
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting * @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. * 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>|module:ol/style/Style~Function)} [style] Layer style. See * @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction)} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined. * {@link ol.style} for default style which will be used if this is not defined.
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error. * @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
*/ */

View File

@@ -15,7 +15,7 @@ import Stroke from '../style/Stroke.js';
* vector layer can be styled. * vector layer can be styled.
* *
* @typedef {function((module:ol/Feature|module:ol/render/Feature), number): * @typedef {function((module:ol/Feature|module:ol/render/Feature), number):
* (module:ol/style/Style|Array.<module:ol/style/Style>)} Function * (module:ol/style/Style|Array.<module:ol/style/Style>)} StyleFunction
*/ */
@@ -324,9 +324,9 @@ Style.prototype.setZIndex = function(zIndex) {
* Convert the provided object into a style function. Functions passed through * 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 * unchanged. Arrays of module:ol/style/Style or single style objects wrapped in a
* new style function. * new style function.
* @param {module:ol/style/Style~Function|Array.<module:ol/style/Style>|module:ol/style/Style} obj * @param {module:ol/style/Style~StyleFunction|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* A style function, a single style, or an array of styles. * 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) { export function toFunction(obj) {
let styleFunction; let styleFunction;