Fix some types

This commit is contained in:
ahocevar
2018-04-27 00:26:03 +02:00
parent ce84c3bf57
commit 59d904e509
25 changed files with 103 additions and 102 deletions

View File

@@ -78,13 +78,13 @@ const Feature = function(opt_geometryOrProperties) {
/**
* User provided style.
* @private
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction}
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function}
*/
this.style_ = null;
/**
* @private
* @type {module:ol/style~StyleFunction|undefined}
* @type {module:ol/style/Style~Function|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>|module:ol/style~StyleFunction} The feature style.
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} 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~StyleFunction|undefined} Return a function
* @return {module:ol/style/Style~Function|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>|module:ol/style~StyleFunction} style Style for this feature.
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} style Style for this feature.
* @api
* @fires module:ol/events/Event~Event#event:change
*/
@@ -252,7 +252,7 @@ Feature.prototype.setStyle = function(style) {
* Set the feature id. The feature id is considered stable and may be used when
* requesting features or comparing identifiers returned from a remote source.
* The feature id can be used with the
* {@link module:ol/source/Vector~Vector#getFeatureById} method.
* {@link module:ol/source/Vector#getFeatureById} method.
* @param {number|string|undefined} id The feature id.
* @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~StyleFunction|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
* @param {module:ol/style/Style~Function|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
* A feature style function, a single style, or an array of styles.
* @return {module:ol/style~StyleFunction} A style function.
* @return {module:ol/style/Style~Function} A style function.
*/
export function createStyleFunction(obj) {
if (typeof obj === 'function') {

View File

@@ -65,7 +65,7 @@ const ImageWrapper = function(extent, resolution, pixelRatio, src, crossOrigin,
/**
* @protected
* @type {module:ol/ImageState~ImageState}
* @type {module:ol/ImageState}
*/
this.state = ImageState.IDLE;

View File

@@ -12,7 +12,7 @@ import EventType from './events/EventType.js';
* @param {module:ol/extent~Extent} extent Extent.
* @param {number|undefined} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {module:ol/ImageState~ImageState} state State.
* @param {module:ol/ImageState} state State.
*/
const ImageBase = function(extent, resolution, pixelRatio, state) {
@@ -38,7 +38,7 @@ const ImageBase = function(extent, resolution, pixelRatio, state) {
/**
* @protected
* @type {module:ol/ImageState~ImageState}
* @type {module:ol/ImageState}
*/
this.state = state;
@@ -87,7 +87,7 @@ ImageBase.prototype.getResolution = function() {
/**
* @return {module:ol/ImageState~ImageState} State.
* @return {module:ol/ImageState} State.
*/
ImageBase.prototype.getState = function() {
return this.state;

View File

@@ -53,7 +53,7 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
* options are added to this group, and `addLayer` and `removeLayer` change the
* layer collection in the group. `getLayers` is a convenience function for
* `getLayerGroup().getLayers()`. Note that {@link module:ol/layer/Group~Group}
* is a subclass of {@link module:ol/layer/Base~Base}, so layers entered in the
* is a subclass of {@link module:ol/layer/Base}, so layers entered in the
* options or added with `addLayer` can be groups, which can contain further
* groups, and so on.
*

View File

@@ -23,7 +23,7 @@ import {containsExtent} from './extent.js';
* shifts the overlay down.
* @property {module:ol/coordinate~Coordinate} [position] The overlay position
* in map projection.
* @property {module:ol/OverlayPositioning~OverlayPositioning} [positioning='top-left'] Defines how
* @property {module:ol/OverlayPositioning} [positioning='top-left'] Defines how
* the overlay is actually positioned with respect to its `position` property.
* Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,
* `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,
@@ -204,7 +204,7 @@ const Overlay = function(options) {
this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);
this.setPositioning(options.positioning !== undefined ?
/** @type {module:ol/OverlayPositioning~OverlayPositioning} */ (options.positioning) :
/** @type {module:ol/OverlayPositioning} */ (options.positioning) :
OverlayPositioning.TOP_LEFT);
if (options.position !== undefined) {
@@ -278,14 +278,14 @@ Overlay.prototype.getPosition = function() {
/**
* Get the current positioning of this overlay.
* @return {module:ol/OverlayPositioning~OverlayPositioning} How the overlay is positioned
* @return {module:ol/OverlayPositioning} How the overlay is positioned
* relative to its point on the map.
* @observable
* @api
*/
Overlay.prototype.getPositioning = function() {
return (
/** @type {module:ol/OverlayPositioning~OverlayPositioning} */ (this.get(Property.POSITIONING))
/** @type {module:ol/OverlayPositioning} */ (this.get(Property.POSITIONING))
);
};
@@ -489,7 +489,7 @@ Overlay.prototype.getRect = function(element, size) {
/**
* Set the positioning for this overlay.
* @param {module:ol/OverlayPositioning~OverlayPositioning} positioning how the overlay is
* @param {module:ol/OverlayPositioning} positioning how the overlay is
* positioned relative to its point on the map.
* @observable
* @api

View File

@@ -101,7 +101,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
* map target (i.e. the user-provided div for the map). If this is not
* `document`, the target element needs to be focused for key events to be
* emitted, requiring that the target element has a `tabindex` attribute.
* @property {Array.<module:ol/layer/Base~Base>|module:ol/Collection.<module:ol/layer/Base~Base>} [layers]
* @property {Array.<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers]
* Layers. If this is not defined, a map with no layers will be rendered. Note
* that layers are rendered in the order supplied, so if you want, for example,
* a vector layer to appear on top of a tile layer, it must come after the tile
@@ -495,7 +495,7 @@ PluggableMap.prototype.addInteraction = function(interaction) {
* Adds the given layer to the top of this map. If you want to add a layer
* elsewhere in the stack, use `getLayers()` and the methods available on
* {@link module:ol/Collection~Collection}.
* @param {module:ol/layer/Base~Base} layer Layer.
* @param {module:ol/layer/Base} layer Layer.
* @api
*/
PluggableMap.prototype.addLayer = function(layer) {
@@ -559,7 +559,7 @@ PluggableMap.prototype.disposeInternal = function() {
* module:ol/layer/Layer): T} callback Feature callback. The callback will be
* called with two arguments. The first argument is one
* {@link module:ol/Feature feature} or
* {@link module:ol/render/Feature~Feature render feature} at the pixel, the second is
* {@link module:ol/render/Feature render feature} at the pixel, the second is
* the {@link module:ol/layer/Layer layer} of the feature and will be null for
* unmanaged layers. To stop detection, callback functions can return a
* truthy value.
@@ -803,7 +803,7 @@ PluggableMap.prototype.getLayerGroup = function() {
/**
* Get the collection of layers associated with this map.
* @return {!module:ol/Collection.<module:ol/layer/Base~Base>} Layers.
* @return {!module:ol/Collection.<module:ol/layer/Base>} Layers.
* @api
*/
PluggableMap.prototype.getLayers = function() {
@@ -1192,8 +1192,8 @@ PluggableMap.prototype.removeInteraction = function(interaction) {
/**
* Removes the given layer from the map.
* @param {module:ol/layer/Base~Base} layer Layer.
* @return {module:ol/layer/Base~Base|undefined} The removed layer (or undefined if the
* @param {module:ol/layer/Base} layer Layer.
* @return {module:ol/layer/Base|undefined} The removed layer (or undefined if the
* layer was not found).
* @api
*/

View File

@@ -54,7 +54,7 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js';
* layer collection in the group. `getLayers` is a convenience function for
* `getLayerGroup().getLayers()`.
* Note that {@link module:ol/layer/Group~Group} is a subclass of
* {@link module:ol/layer/Base~Base}, so layers entered in the options or added
* {@link module:ol/layer/Base}, so layers entered in the options or added
* with `addLayer` can be groups, which can contain further groups, and so on.
*
* @constructor

View File

@@ -6,25 +6,25 @@ import FormatType from './format/FormatType.js';
/**
* {@link module:ol/source/Vector~Vector} sources use a function of this type to
* {@link module:ol/source/Vector} sources use a function of this type to
* load features.
*
* This function takes an {@link module:ol/extent~Extent} representing the area to be loaded,
* a `{number}` representing the resolution (map units per pixel) and an
* {@link module:ol/proj/Projection} for the projection as
* arguments. `this` within the function is bound to the
* {@link module:ol/source/Vector~Vector} it's called from.
* {@link module:ol/source/Vector} it's called from.
*
* The function is responsible for loading the features and adding them to the
* source.
* @typedef {function(this:module:ol/source/Vector~Vector, module:ol/extent~Extent, number,
* @typedef {function(this:module:ol/source/Vector, module:ol/extent~Extent, number,
* module:ol/proj/Projection)} FeatureLoader
* @api
*/
/**
* {@link module:ol/source/Vector~Vector} sources use a function of this type to
* {@link module:ol/source/Vector} sources use a function of this type to
* get the url to load features from.
*
* This function takes an {@link module:ol/extent~Extent} representing the area
@@ -39,10 +39,10 @@ import FormatType from './format/FormatType.js';
/**
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
* @param {module:ol/format/Feature} format Feature format.
* @param {function(this:module:ol/VectorTile, Array.<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector~Vector, Array.<module:ol/Feature>)} success
* @param {function(this:module:ol/VectorTile, Array.<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector, Array.<module:ol/Feature>)} success
* Function called with the loaded features and optionally with the data
* projection. Called with the vector tile or source as `this`.
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector~Vector)} failure
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector)} failure
* Function called when loading failed. Called with the vector tile or
* source as `this`.
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
@@ -53,7 +53,7 @@ export function loadFeaturesXhr(url, format, success, failure) {
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {module:ol/proj/Projection} projection Projection.
* @this {module:ol/source/Vector~Vector|module:ol/VectorTile}
* @this {module:ol/source/Vector|module:ol/VectorTile}
*/
function(extent, resolution, projection) {
const xhr = new XMLHttpRequest();
@@ -121,7 +121,7 @@ export function xhr(url, format) {
* @param {Array.<module:ol/Feature>} features The loaded features.
* @param {module:ol/proj/Projection} dataProjection Data
* projection.
* @this {module:ol/source/Vector~Vector}
* @this {module:ol/source/Vector}
*/
function(features, dataProjection) {
this.addFeatures(features);

View File

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

View File

@@ -40,7 +40,7 @@ import {createEditingStyle} from '../style/Style.js';
* on touch devices.
* @property {module:ol/Collection.<module:ol/Feature>} [features]
* Destination collection for the drawn features.
* @property {module:ol/source/Vector~Vector} [source] Destination source for
* @property {module:ol/source/Vector} [source] Destination source for
* the drawn features.
* @property {number} [dragVertexDelay=500] Delay in milliseconds after pointerdown
* before the current vertex can be dragged to its exact position.
@@ -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>|module:ol/style~StyleFunction} [style]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [style]
* Style for sketch features.
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
* Function that is called when a geometry's coordinates are updated.
@@ -201,7 +201,7 @@ const Draw = function(options) {
/**
* Target source for drawn features.
* @type {module:ol/source/Vector~Vector}
* @type {module:ol/source/Vector}
* @private
*/
this.source_ = options.source ? options.source : null;
@@ -437,7 +437,7 @@ inherits(Draw, PointerInteraction);
/**
* @return {module:ol/style~StyleFunction} Styles.
* @return {module:ol/style/Style~Function} Styles.
*/
function getDefaultStyleFunction() {
const styles = createEditingStyle();

View File

@@ -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>|module:ol/style~StyleFunction} [boxStyle]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [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>|module:ol/style~StyleFunction} [pointerStyle]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [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~StyleFunction} Default Extent style
* @return {module:ol/style/Style~Function} 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~StyleFunction} Default pointer style
* @return {module:ol/style/Style~Function} Default pointer style
*/
function getDefaultPointerStyleFunction() {
const style = createEditingStyle();

View File

@@ -72,10 +72,10 @@ 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>|module:ol/style~StyleFunction} [style]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [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~Vector} [source] The vector source with
* @property {module:ol/source/Vector} [source] The vector source with
* features to modify. If a vector source is not provided, a feature collection
* must be provided with the features option.
* @property {module:ol/Collection.<module:ol/Feature>} [features]
@@ -283,7 +283,7 @@ const Modify = function(options) {
/**
* @type {module:ol/source/Vector~Vector}
* @type {module:ol/source/Vector}
* @private
*/
this.source_ = null;
@@ -1267,7 +1267,7 @@ Modify.prototype.updateSegmentIndices_ = function(
/**
* @return {module:ol/style~StyleFunction} Styles.
* @return {module:ol/style/Style~Function} Styles.
*/
function getDefaultStyleFunction() {
const style = createEditingStyle();

View File

@@ -31,7 +31,7 @@ const SelectEventType = {
/**
* A function that takes an {@link module:ol/Feature} or
* {@link module:ol/render/Feature~Feature} and an
* {@link module:ol/render/Feature} and an
* {@link module:ol/layer/Layer} and returns `true` if the feature may be
* selected or `false` otherwise.
* @typedef {function((module:ol/Feature|module:ol/render/Feature), module:ol/layer/Layer):
@@ -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>|module:ol/style~StyleFunction} [style]
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [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~StyleFunction} Styles.
* @return {module:ol/style/Style~Function} Styles.
*/
function getDefaultStyleFunction() {
const styles = createEditingStyle();

View File

@@ -40,14 +40,14 @@ import RBush from '../structs/RBush.js';
* @property {boolean} [vertex=true] Snap to vertices.
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the pointer close enough to a segment or
* vertex for snapping.
* @property {module:ol/source/Vector~Vector} [source] Snap to features from this source. Either this option or features should be provided
* @property {module:ol/source/Vector} [source] Snap to features from this source. Either this option or features should be provided
*/
/**
* @classdesc
* Handles snapping of vector features while modifying or drawing them. The
* features can come from a {@link module:ol/source/Vector~Vector} or {@link module:ol/Collection~Collection}
* features can come from a {@link module:ol/source/Vector} or {@link module:ol/Collection~Collection}
* Any interaction object that allows the user to interact
* with the features using the mouse can benefit from the snapping, as long
* as it is added before.
@@ -79,7 +79,7 @@ const Snap = function(opt_options) {
const options = opt_options ? opt_options : {};
/**
* @type {module:ol/source/Vector~Vector}
* @type {module:ol/source/Vector}
* @private
*/
this.source_ = options.source ? options.source : null;
@@ -245,7 +245,7 @@ Snap.prototype.getFeatures_ = function() {
/**
* @param {module:ol/source/Vector~Vector|module:ol/Collection~CollectionEvent} evt Event.
* @param {module:ol/source/Vector|module:ol/Collection~CollectionEvent} evt Event.
* @private
*/
Snap.prototype.handleFeatureAdd_ = function(evt) {
@@ -260,7 +260,7 @@ Snap.prototype.handleFeatureAdd_ = function(evt) {
/**
* @param {module:ol/source/Vector~Vector|module:ol/Collection~CollectionEvent} evt Event.
* @param {module:ol/source/Vector|module:ol/Collection~CollectionEvent} evt Event.
* @private
*/
Snap.prototype.handleFeatureRemove_ = function(evt) {

View File

@@ -27,7 +27,7 @@ import {assign} from '../obj.js';
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Note that with `module:ol/layer/Base~BaseLayer` and all its subclasses, any property set in
* Note that with `module:ol/layer/BaseLayer` and all its subclasses, any property set in
* the options is set as a {@link module:ol/Object property on the layer object, so
* is observable, and has get/set accessors.
*

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
* 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>|module:ol/style~StyleFunction} [style] Layer style. See
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [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>|module:ol/style~StyleFunction}
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function}
* @private
*/
this.style_ = null;
/**
* Style function for use within the library.
* @type {module:ol/style~StyleFunction|undefined}
* @type {module:ol/style/Style~Function|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>|module:ol/style~StyleFunction}
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function}
* Layer style.
* @api
*/
@@ -221,7 +221,7 @@ VectorLayer.prototype.getStyle = function() {
/**
* Get the style function.
* @return {module:ol/style~StyleFunction|undefined} Layer style function.
* @return {module:ol/style/Style~Function|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>|module:ol/style~StyleFunction|null|undefined}
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function|null|undefined}
* style Layer style.
* @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
* 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>|module:ol/style~StyleFunction} [style] Layer style. See
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function} [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>|module:ol/style~StyleFunction)} [style] Layer style. See
* @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~Function)} [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.
*/

View File

@@ -33,7 +33,7 @@ import RBush from '../structs/RBush.js';
/**
* @classdesc
* Events emitted by {@link module:ol/source/Vector~VectorSource} instances are instances of this
* Events emitted by {@link module:ol/source/VectorSource} instances are instances of this
* type.
*
* @constructor
@@ -65,7 +65,7 @@ inherits(VectorSourceEvent, Event);
* and the collection will stay in sync.
* @property {module:ol/format/Feature} [format] The feature format used by the XHR
* feature loader when `url` is set. Required if `url` is set, otherwise ignored.
* @property {module:ol/Feature~FeatureLoader} [loader]
* @property {module:ol/featureloader~FeatureLoader} [loader]
* The loader function used to load features, from a remote source for example.
* If this is not set and `url` is set, the source will create and use an XHR
* feature loader.
@@ -73,7 +73,7 @@ inherits(VectorSourceEvent, Event);
* Example:
*
* ```js
* var vectorSource = new module:ol/source/Vector~VectorSource({
* var vectorSource = new module:ol/source/VectorSource({
* format: new ol.format.GeoJSON(),
* loader: function(extent, resolution, projection) {
* var proj = projection.getCode();
@@ -107,11 +107,11 @@ inherits(VectorSourceEvent, Event);
* @property {module:ol/source/Vector~LoadingStrategy} [strategy] The loading strategy to use.
* By default an {@link ol.loadingstrategy.all}
* strategy is used, a one-off strategy which loads all features at once.
* @property {string|module:ol/Feature~FeatureUrlFunction} [url]
* @property {string|module:ol/featureloader~FeatureUrlfunction} [url]
* Setting this option instructs the source to load features using an XHR loader
* (see {@link ol.featureloader.xhr}). Use a `string` and an
* {@link ol.loadingstrategy.all} for a one-off download of all features from
* the given URL. Use a {@link module:ol/Feature~FeatureUrlFunction} to generate the url with
* the given URL. Use a {@link module:ol/featureloader~FeatureUrlfunction} to generate the url with
* other loading strategies.
* Requires `format` to be set as well.
* When default XHR feature loader is provided, the features will
@@ -128,15 +128,15 @@ inherits(VectorSourceEvent, Event);
* `false` may improve performance.
*
* Note that
* {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent},
* {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and
* {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is
* set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop
* {@link module:ol/source/VectorSource#getFeaturesInExtent},
* {@link module:ol/source/VectorSource#getClosestFeatureToCoordinate} and
* {@link module:ol/source/VectorSource#getExtent} cannot be used when `useSpatialIndex` is
* set to `false`, and {@link module:ol/source/VectorSource#forEachFeatureInExtent} will loop
* through all features.
*
* When set to `false`, the features will be maintained in an
* {@link module:ol/Collection}, which can be retrieved through
* {@link module:ol/source/Vector~VectorSource#getFeaturesCollection}.
* {@link module:ol/source/VectorSource#getFeaturesCollection}.
* @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the
* -180° and 180° meridians to work properly, this should be set to `false`. The
* resulting geometry coordinates will then exceed the world bounds.
@@ -275,7 +275,7 @@ inherits(VectorSource, Source);
/**
* Add a single feature to the source. If you want to add a batch of features
* at once, call {@link module:ol/source/Vector~VectorSource#addFeatures source.addFeatures()}
* at once, call {@link module:ol/source/VectorSource#addFeatures source.addFeatures()}
* instead. A feature will not be added to the source if feature with
* the same id is already there. The reason for this behavior is to avoid
* feature duplication when using bbox or tile loading strategies.
@@ -545,11 +545,11 @@ VectorSource.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, c
* value, iteration will stop and the function will return the same value.
*
* If you are interested in features whose geometry intersects an extent, call
* the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent
* the {@link module:ol/source/VectorSource#forEachFeatureIntersectingExtent
* source.forEachFeatureIntersectingExtent()} method instead.
*
* When `useSpatialIndex` is set to false, this method will loop through all
* features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature}.
* features, equivalent to {@link module:ol/source/VectorSource#forEachFeature}.
*
* @param {module:ol/extent~Extent} extent Extent.
* @param {function(module:ol/Feature): T} callback Called with each feature
@@ -573,7 +573,7 @@ VectorSource.prototype.forEachFeatureInExtent = function(extent, callback) {
* value, iteration will stop and the function will return the same value.
*
* If you only want to test for bounding box intersection, call the
* {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent
* {@link module:ol/source/VectorSource#forEachFeatureInExtent
* source.forEachFeatureInExtent()} method instead.
*
* @param {module:ol/extent~Extent} extent Extent.
@@ -910,7 +910,7 @@ VectorSource.prototype.removeLoadedExtent = function(extent) {
/**
* Remove a single feature from the source. If you want to remove all features
* at once, use the {@link module:ol/source/Vector~VectorSource#clear source.clear()} method
* at once, use the {@link module:ol/source/VectorSource#clear source.clear()} method
* instead.
* @param {module:ol/Feature} feature Feature to remove.
* @api

View File

@@ -59,7 +59,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* with vector features from the server, it is not meant for feature editing.
* Features are optimized for rendering, their geometries are clipped at or near
* tile boundaries and simplified for a view resolution. See
* {@link module:ol/source/Vector~VectorSource} for vector sources that are suitable for feature
* {@link module:ol/source/VectorSource} for vector sources that are suitable for feature
* editing.
*
* @constructor

View File

@@ -3,17 +3,6 @@
*/
/**
* A function that takes an {@link module:ol/Feature} and a `{number}`
* representing the view's resolution. The function should return a
* {@link module:ol/style/Style} or an array of them. This way e.g. a
* vector layer can be styled.
*
* @typedef {function((module:ol/Feature|module:ol/render/Feature), number):
* (module:ol/style/Style|Array.<module:ol/style/Style>)} StyleFunction
* @api
*/
export {default as Atlas} from './style/Atlas.js';
export {default as AtlasManager} from './style/AtlasManager.js';
export {default as Circle} from './style/Circle.js';

View File

@@ -132,7 +132,7 @@ const Icon = function(opt_options) {
6); // A defined and non-empty `src` or `image` must be provided
/**
* @type {module:ol/ImageState~ImageState}
* @type {module:ol/ImageState}
*/
const imageState = options.src !== undefined ?
ImageState.IDLE : ImageState.LOADED;

View File

@@ -15,7 +15,7 @@ import {shared as iconImageCache} from '../style/IconImageCache.js';
* @param {string|undefined} src Src.
* @param {module:ol/size~Size} size Size.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/ImageState~ImageState} imageState Image state.
* @param {module:ol/ImageState} imageState Image state.
* @param {module:ol/color~Color} color Color.
* @extends {module:ol/events/EventTarget}
*/
@@ -61,7 +61,7 @@ const IconImage = function(image, src, size, crossOrigin, imageState, color) {
/**
* @private
* @type {module:ol/ImageState~ImageState}
* @type {module:ol/ImageState}
*/
this.imageState_ = imageState;
@@ -96,7 +96,7 @@ inherits(IconImage, EventTarget);
* @param {string} src Src.
* @param {module:ol/size~Size} size Size.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/ImageState~ImageState} imageState Image state.
* @param {module:ol/ImageState} imageState Image state.
* @param {module:ol/color~Color} color Color.
* @return {module:ol/style/IconImage} Icon image.
*/
@@ -169,7 +169,7 @@ IconImage.prototype.getImage = function(pixelRatio) {
/**
* @return {module:ol/ImageState~ImageState} Image state.
* @return {module:ol/ImageState} Image state.
*/
IconImage.prototype.getImageState = function() {
return this.imageState_;

View File

@@ -137,7 +137,7 @@ ImageStyle.prototype.getHitDetectionImage = function(pixelRatio) {};
/**
* @abstract
* @return {module:ol/ImageState~ImageState} Image state.
* @return {module:ol/ImageState} Image state.
*/
ImageStyle.prototype.getImageState = function() {};

View File

@@ -7,6 +7,18 @@ import CircleStyle from '../style/Circle.js';
import Fill from '../style/Fill.js';
import Stroke from '../style/Stroke.js';
/**
* A function that takes an {@link module:ol/Feature} and a `{number}`
* representing the view's resolution. The function should return a
* {@link module:ol/style/Style} or an array of them. This way e.g. a
* vector layer can be styled.
*
* @typedef {function((module:ol/Feature|module:ol/render/Feature), number):
* (module:ol/style/Style|Array.<module:ol/style/Style>)} Function
*/
/**
* A function that takes an {@link module:ol/Feature} as argument and returns an
* {@link module:ol/geom/Geometry} that will be rendered and styled for the feature.
@@ -312,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~StyleFunction|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* @param {module:ol/style/Style~Function|Array.<module:ol/style/Style>|module:ol/style/Style} obj
* A style function, a single style, or an array of styles.
* @return {module:ol/style~StyleFunction} A style function.
* @return {module:ol/style/Style~Function} A style function.
*/
export function toFunction(obj) {
let styleFunction;

View File

@@ -24,7 +24,7 @@ const DEFAULT_FILL_COLOR = '#333';
* @property {number} [offsetY=0] Vertical text offset in pixels. A positive will shift the text down.
* @property {boolean} [overflow=false] For polygon labels or when `placement` is set to `'line'`, allow text to exceed
* the width of the polygon at the label position or the length of the path that it follows.
* @property {module:ol/style/TextPlacement~TextPlacement|string} [placement] Text placement.
* @property {module:ol/style/TextPlacement|string} [placement] Text placement.
* @property {number} [scale] Scale.
* @property {boolean} [rotateWithView=false] Whether to rotate the text with the view.
* @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).
@@ -114,7 +114,7 @@ const Text = function(opt_options) {
/**
* @private
* @type {module:ol/style/TextPlacement~TextPlacement|string}
* @type {module:ol/style/TextPlacement|string}
*/
this.placement_ = options.placement !== undefined ? options.placement : TextPlacement.POINT;
@@ -221,7 +221,7 @@ Text.prototype.getMaxAngle = function() {
/**
* Get the label placement.
* @return {module:ol/style/TextPlacement~TextPlacement|string} Text placement.
* @return {module:ol/style/TextPlacement|string} Text placement.
* @api
*/
Text.prototype.getPlacement = function() {
@@ -417,7 +417,7 @@ Text.prototype.setOffsetY = function(offsetY) {
/**
* Set the text placement.
*
* @param {module:ol/style/TextPlacement~TextPlacement|string} placement Placement.
* @param {module:ol/style/TextPlacement|string} placement Placement.
* @api
*/
Text.prototype.setPlacement = function(placement) {