From 417dd85f8326c7604160696e56642aae6f34338e Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 21 Apr 2018 00:20:04 +0200 Subject: [PATCH 1/3] Fix some jsdoc path types --- src/ol/Collection.js | 2 +- src/ol/Feature.js | 4 ++-- src/ol/Geolocation.js | 2 +- src/ol/ImageTile.js | 8 +++++++- src/ol/Object.js | 4 ++-- src/ol/Overlay.js | 2 +- src/ol/PluggableMap.js | 2 +- src/ol/Tile.js | 9 ++++----- src/ol/VectorImageTile.js | 4 ++-- src/ol/VectorTile.js | 8 +++++++- src/ol/View.js | 2 +- src/ol/interaction/DragBox.js | 2 +- src/ol/interaction/DragPan.js | 2 +- src/ol/interaction/DragRotate.js | 2 +- src/ol/interaction/DragRotateAndZoom.js | 2 +- src/ol/interaction/Draw.js | 2 +- src/ol/interaction/Extent.js | 2 +- src/ol/interaction/Interaction.js | 2 +- src/ol/interaction/Modify.js | 2 +- src/ol/interaction/PinchRotate.js | 2 +- src/ol/interaction/PinchZoom.js | 2 +- src/ol/interaction/Snap.js | 2 +- src/ol/interaction/Translate.js | 2 +- src/ol/layer/Base.js | 2 +- src/ol/layer/Heatmap.js | 2 +- src/ol/layer/Image.js | 2 +- src/ol/layer/Tile.js | 2 +- src/ol/layer/Vector.js | 2 +- src/ol/layer/VectorTile.js | 2 +- src/ol/renderer/Map.js | 2 +- src/ol/source/TileImage.js | 6 ++---- src/ol/source/TileUTFGrid.js | 2 +- src/ol/source/TileWMS.js | 6 ++---- src/ol/source/VectorTile.js | 6 ++---- src/ol/source/WMTS.js | 4 +--- src/ol/source/Zoomify.js | 2 +- 36 files changed, 57 insertions(+), 54 deletions(-) diff --git a/src/ol/Collection.js b/src/ol/Collection.js index 875bfe28a6..8b4f31b85f 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -59,7 +59,7 @@ inherits(CollectionEvent, Event); * Collection as a whole. * * @constructor - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @fires module:ol/Collection~CollectionEvent * @param {Array.=} opt_array Array. * @param {module:ol/Collection~Options=} opt_options Collection options. diff --git a/src/ol/Feature.js b/src/ol/Feature.js index e224b9aaa8..c7f7d46151 100644 --- a/src/ol/Feature.js +++ b/src/ol/Feature.js @@ -18,7 +18,7 @@ import Style from './style/Style.js'; * Features can be styled individually with `setStyle`; otherwise they use the * style of their vector layer. * - * Note that attribute properties are set as {@link module:ol/Object~Object} properties on + * Note that attribute properties are set as {@link module:ol/Object~BaseObject} properties on * the feature object, so they are observable, and have get/set accessors. * * Typically, a feature has a single geometry property. You can set the @@ -52,7 +52,7 @@ import Style from './style/Style.js'; * ``` * * @constructor - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @param {module:ol/geom/Geometry~Geometry|Object.=} opt_geometryOrProperties * You may pass a Geometry object directly, or an object literal containing * properties. If you pass an object literal, you may include a Geometry diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index cbe31eb03d..52e387060e 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -45,7 +45,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr * * @fires error * @constructor - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @param {module:ol/Geolocation~Options=} opt_options Options. * @api */ diff --git a/src/ol/ImageTile.js b/src/ol/ImageTile.js index 4449738e0f..70d953fb37 100644 --- a/src/ol/ImageTile.js +++ b/src/ol/ImageTile.js @@ -8,11 +8,17 @@ import {createCanvasContext2D} from './dom.js'; import {listenOnce, unlistenByKey} from './events.js'; import EventType from './events/EventType.js'; +/** + * @typedef {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, + * module:ol/TileState, string, ?string, ol.TileLoadFunctionType)} TileClass + * @api + */ + /** * @constructor * @extends {module:ol/Tile~Tile} * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. * @param {string} src Image source URI. * @param {?string} crossOrigin Cross origin. * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. diff --git a/src/ol/Object.js b/src/ol/Object.js index f76e0632a9..82c13060a7 100644 --- a/src/ol/Object.js +++ b/src/ol/Object.js @@ -10,7 +10,7 @@ import {assign} from './obj.js'; /** * @classdesc - * Events emitted by {@link module:ol/Object~Object} instances are instances of + * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of * this type. * * @param {string} type The event type. @@ -71,7 +71,7 @@ inherits(ObjectEvent, Event); * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`. * You can listen for changes on that property value with * `object.on('change:prop', listener)`. You can get a list of all - * properties with {@link module:ol/Object~Object#getProperties}. + * properties with {@link module:ol/Object~BaseObject#getProperties}. * * Note that the observable properties are separate from standard JS properties. * You can, for example, give your map object a title with diff --git a/src/ol/Overlay.js b/src/ol/Overlay.js index 6c9945c7b8..306ab8b55b 100644 --- a/src/ol/Overlay.js +++ b/src/ol/Overlay.js @@ -94,7 +94,7 @@ const Property = { * map.addOverlay(popup); * * @constructor - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @param {module:ol/Overlay~Options} options Overlay options. * @api */ diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 3708582d58..8c4b285034 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -132,7 +132,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js /** * @constructor - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @param {module:ol/PluggableMap~MapOptions} options Map options. * @fires module:ol/MapBrowserEvent~MapBrowserEvent * @fires module:ol/MapEvent~MapEvent diff --git a/src/ol/Tile.js b/src/ol/Tile.js index 2d59a3e037..677bf9cbe9 100644 --- a/src/ol/Tile.js +++ b/src/ol/Tile.js @@ -16,7 +16,6 @@ import EventType from './events/EventType.js'; * @api */ - /** * {@link module:ol/source/Tile~Tile} sources use a function of this type to get * the url that provides a tile for a given tile coordinate. @@ -49,7 +48,7 @@ import EventType from './events/EventType.js'; * @abstract * @extends {module:ol/events/EventTarget~EventTarget} * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. * @param {module:ol/Tile~Options=} opt_options Tile options. */ const Tile = function(tileCoord, state, opt_options) { @@ -64,7 +63,7 @@ const Tile = function(tileCoord, state, opt_options) { /** * @protected - * @type {module:ol/TileState~TileState} + * @type {module:ol/TileState} */ this.state = state; @@ -190,14 +189,14 @@ Tile.prototype.getTileCoord = function() { /** - * @return {module:ol/TileState~TileState} State. + * @return {module:ol/TileState} State. */ Tile.prototype.getState = function() { return this.state; }; /** - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. */ Tile.prototype.setState = function(state) { this.state = state; diff --git a/src/ol/VectorImageTile.js b/src/ol/VectorImageTile.js index f6c29498b3..c28b0ca06b 100644 --- a/src/ol/VectorImageTile.js +++ b/src/ol/VectorImageTile.js @@ -24,7 +24,7 @@ import {loadFeaturesXhr} from './featureloader.js'; * @constructor * @extends {module:ol/Tile~Tile} * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. * @param {number} sourceRevision Source revision. * @param {module:ol/format/Feature~FeatureFormat} format Feature format. * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. @@ -35,7 +35,7 @@ import {loadFeaturesXhr} from './featureloader.js'; * @param {Object.} sourceTiles Source tiles. * @param {number} pixelRatio Pixel ratio. * @param {module:ol/proj/Projection~Projection} projection Projection. - * @param {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, + * @param {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string, * module:ol/format/Feature~FeatureFormat, module:ol/Tile~LoadFunction)} tileClass Class to * instantiate for source tiles. * @param {function(this: module:ol/source/VectorTile~VectorTile, module:ol/events/Event~Event)} handleTileChange diff --git a/src/ol/VectorTile.js b/src/ol/VectorTile.js index 0a8fdec58d..56eddac1b7 100644 --- a/src/ol/VectorTile.js +++ b/src/ol/VectorTile.js @@ -5,11 +5,17 @@ import {getUid, inherits} from './index.js'; import Tile from './Tile.js'; import TileState from './TileState.js'; +/** + * @typedef {function(new: ol.VectorTile, module:ol/tilecoord~TileCoord, + * module:ol/TileState, string, ?string, ol.TileLoadFunctionType)} TileClass + * @api + */ + /** * @constructor * @extends {module:ol/Tile~Tile} * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. * @param {string} src Data source url. * @param {module:ol/format/Feature~FeatureFormat} format Feature format. * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. diff --git a/src/ol/View.js b/src/ol/View.js index 428ba21612..5e948456e8 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -225,7 +225,7 @@ const DEFAULT_MIN_ZOOM = 0; * default the center is not constrained at all. * * @constructor - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @param {module:ol/View~ViewOptions=} opt_options View options. * @api */ diff --git a/src/ol/interaction/DragBox.js b/src/ol/interaction/DragBox.js index 79219b8218..b457941e3b 100644 --- a/src/ol/interaction/DragBox.js +++ b/src/ol/interaction/DragBox.js @@ -106,7 +106,7 @@ inherits(DragBoxEvent, Event); * This interaction is only supported for mouse devices. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @fires module:ol/interaction/DragBox~DragBoxEvent * @param {module:ol/interaction/DragBox~Options=} opt_options Options. * @api diff --git a/src/ol/interaction/DragPan.js b/src/ol/interaction/DragPan.js index dc4af231e9..605af92b80 100644 --- a/src/ol/interaction/DragPan.js +++ b/src/ol/interaction/DragPan.js @@ -24,7 +24,7 @@ import PointerInteraction, {centroid as centroidFromPointers} from '../interacti * Allows the user to pan the map by dragging the map. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/DragPan~Options=} opt_options Options. * @api */ diff --git a/src/ol/interaction/DragRotate.js b/src/ol/interaction/DragRotate.js index 6918b0a882..edeafbb70c 100644 --- a/src/ol/interaction/DragRotate.js +++ b/src/ol/interaction/DragRotate.js @@ -29,7 +29,7 @@ import PointerInteraction from '../interaction/Pointer.js'; * This interaction is only supported for mouse devices. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/DragRotate~Options=} opt_options Options. * @api */ diff --git a/src/ol/interaction/DragRotateAndZoom.js b/src/ol/interaction/DragRotateAndZoom.js index 6bce4eda34..b16bc7d100 100644 --- a/src/ol/interaction/DragRotateAndZoom.js +++ b/src/ol/interaction/DragRotateAndZoom.js @@ -30,7 +30,7 @@ import PointerInteraction from '../interaction/Pointer.js'; * And this interaction is not included in the default interactions. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/DragRotateAndZoom~Options=} opt_options Options. * @api */ diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index 1b0ca73603..977a0580f2 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -156,7 +156,7 @@ inherits(DrawEvent, Event); * Interaction for drawing feature geometries. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @fires module:ol/interaction/Draw~DrawEvent * @param {module:ol/interaction/Draw~Options} options Options. * @api diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index 2eb17c3397..210b460400 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -78,7 +78,7 @@ inherits(ExtentInteractionEvent, Event); * This interaction is only supported for mouse devices. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @fires module:ol/interaction/Extent~Event * @param {module:ol/interaction/Extent~Options=} opt_options Options. * @api diff --git a/src/ol/interaction/Interaction.js b/src/ol/interaction/Interaction.js index 61b756568b..105a8771f4 100644 --- a/src/ol/interaction/Interaction.js +++ b/src/ol/interaction/Interaction.js @@ -33,7 +33,7 @@ import {clamp} from '../math.js'; * * @constructor * @param {module:ol/interaction/Interaction~InteractionOptions} options Options. - * @extends {module:ol/Object~Object} + * @extends {module:ol/Object~BaseObject} * @api */ const Interaction = function(options) { diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index e558adb12c..c154297f67 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -136,7 +136,7 @@ inherits(ModifyEvent, Event); * for deletion, use the `deleteCondition` option. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/Modify~Options} options Options. * @fires module:ol/interaction/Modify~ModifyEvent * @api diff --git a/src/ol/interaction/PinchRotate.js b/src/ol/interaction/PinchRotate.js index b63f8ea744..936fb5fc8f 100644 --- a/src/ol/interaction/PinchRotate.js +++ b/src/ol/interaction/PinchRotate.js @@ -23,7 +23,7 @@ import {disable} from '../rotationconstraint.js'; * on a touch screen. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/PinchRotate~Options=} opt_options Options. * @api */ diff --git a/src/ol/interaction/PinchZoom.js b/src/ol/interaction/PinchZoom.js index 6ef98bf231..9ba11725d4 100644 --- a/src/ol/interaction/PinchZoom.js +++ b/src/ol/interaction/PinchZoom.js @@ -22,7 +22,7 @@ import PointerInteraction, {centroid as centroidFromPointers} from '../interacti * on a touch screen. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/PinchZoom~Options=} opt_options Options. * @api */ diff --git a/src/ol/interaction/Snap.js b/src/ol/interaction/Snap.js index 79dfa4d48c..7c333d4400 100644 --- a/src/ol/interaction/Snap.js +++ b/src/ol/interaction/Snap.js @@ -64,7 +64,7 @@ import RBush from '../structs/RBush.js'; * }); * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @param {module:ol/interaction/Snap~Options=} opt_options Options. * @api */ diff --git a/src/ol/interaction/Translate.js b/src/ol/interaction/Translate.js index 81d1ce9d9b..090b8ac561 100644 --- a/src/ol/interaction/Translate.js +++ b/src/ol/interaction/Translate.js @@ -92,7 +92,7 @@ inherits(TranslateEvent, Event); * Interaction for translating (moving) features. * * @constructor - * @extends {module:ol/interaction/Pointer~Pointer} + * @extends {module:ol/interaction/Pointer~PointerInteraction} * @fires module:ol/interaction/Translate~TranslateEvent * @param {module:ol/interaction/Translate~Options=} opt_options Options. * @api diff --git a/src/ol/layer/Base.js b/src/ol/layer/Base.js index a00d5ebbc4..8df8e18751 100644 --- a/src/ol/layer/Base.js +++ b/src/ol/layer/Base.js @@ -28,7 +28,7 @@ import {assign} from '../obj.js'; * 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 - * the options is set as a {@link module:ol/Object~BaseObject} property on the layer object, so + * the options is set as a {@link module:ol/Object~BaseObject property on the layer object, so * is observable, and has get/set accessors. * * @constructor diff --git a/src/ol/layer/Heatmap.js b/src/ol/layer/Heatmap.js index c76dd9f71b..b97a12ab68 100644 --- a/src/ol/layer/Heatmap.js +++ b/src/ol/layer/Heatmap.js @@ -58,7 +58,7 @@ const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00']; /** * @classdesc * Layer for rendering vector data as a heatmap. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * diff --git a/src/ol/layer/Image.js b/src/ol/layer/Image.js index abe92c0cd2..e8b3bfce86 100644 --- a/src/ol/layer/Image.js +++ b/src/ol/layer/Image.js @@ -30,7 +30,7 @@ import Layer from '../layer/Layer.js'; * @classdesc * Server-rendered images that are available for arbitrary extents and * resolutions. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * diff --git a/src/ol/layer/Tile.js b/src/ol/layer/Tile.js index 6145fa7cce..0453957d21 100644 --- a/src/ol/layer/Tile.js +++ b/src/ol/layer/Tile.js @@ -35,7 +35,7 @@ import {assign} from '../obj.js'; * @classdesc * For layer sources that provide pre-rendered, tiled images in grids that are * organized by zoom levels for specific resolutions. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * diff --git a/src/ol/layer/Vector.js b/src/ol/layer/Vector.js index c36994dbc9..5dbc24e1e2 100644 --- a/src/ol/layer/Vector.js +++ b/src/ol/layer/Vector.js @@ -64,7 +64,7 @@ const Property = { /** * @classdesc * Vector data that is rendered client-side. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * Note that any property set in the options is set as a {@link } * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * diff --git a/src/ol/layer/VectorTile.js b/src/ol/layer/VectorTile.js index 9aa4b99878..e7c663cb4c 100644 --- a/src/ol/layer/VectorTile.js +++ b/src/ol/layer/VectorTile.js @@ -71,7 +71,7 @@ import {assign} from '../obj.js'; /** * @classdesc * Layer for vector tile data that is rendered client-side. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * Note that any property set in the options is set as a {@link } * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * diff --git a/src/ol/renderer/Map.js b/src/ol/renderer/Map.js index c67a599d98..961f22d492 100644 --- a/src/ol/renderer/Map.js +++ b/src/ol/renderer/Map.js @@ -41,7 +41,7 @@ const MapRenderer = function(map) { /** * @private - * @type {Array.} */ this.layerRendererConstructors_ = []; diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 01bead8ebe..300b2c75b1 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -27,9 +27,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js'; * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {module:ol/source/State~State} [state] Source state. - * @property {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, - * module:ol/TileState~TileState, string, ?string, - * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. + * @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles. * Default is {@link module:ol/ImageTile~ImageTile}. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid. * @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL. The default is @@ -95,7 +93,7 @@ const TileImage = function(options) { /** * @protected - * @type {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, + * @type {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string, * ?string, module:ol/Tile~LoadFunction, module:ol/Tile~Options=)} */ this.tileClass = options.tileClass !== undefined ? diff --git a/src/ol/source/TileUTFGrid.js b/src/ol/source/TileUTFGrid.js index 599c9915f5..f86044f93c 100644 --- a/src/ol/source/TileUTFGrid.js +++ b/src/ol/source/TileUTFGrid.js @@ -21,7 +21,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; * @constructor * @extends {module:ol/Tile~Tile} * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. * @param {string} src Image source URI. * @param {module:ol/extent~Extent} extent Extent of the tile. * @param {boolean} preemptive Load the tile when visible (before it's needed). diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index b8c5b7fe85..e55f92bbda 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -43,10 +43,8 @@ import {appendParams} from '../uri.js'; * @property {module:ol/proj~ProjectionLike} projection Projection. * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. - * @property {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, - * module:ol/TileState~TileState, string, ?string, - * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. - * Default is {@link module:ol/ImageTile~ImageTile}. + * @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles. + * Default is {@link module:ol/ImageTile~TileClass}. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid. Base this on the resolutions, * tilesize and extent supported by the server. * If this is not defined, a default grid will be used: if there is a projection diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index 40b2b1b3f9..41f1f0f1e3 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -21,9 +21,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid. * stroke operations. * @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/source/State~State} [state] Source state. - * @property {function(new: ol.VectorTile, module:ol/tilecoord~TileCoord, - * module:ol/TileState~TileState, string, ?string, - * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. + * @property {module:ol/VectorTile~TileClass} [tileClass] Class used to instantiate image tiles. * Default is {@link ol.VectorTile}. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid. * @property {ol.TileLoadFunctionType} [tileLoadFunction] @@ -118,7 +116,7 @@ const VectorTile = function(options) { /** * @protected - * @type {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, + * @type {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string, * module:ol/format/Feature~FeatureFormat, module:ol/Tile~LoadFunction)} */ this.tileClass = options.tileClass ? options.tileClass : Tile; diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index f78af486ca..aac4e2e068 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -27,9 +27,7 @@ import {appendParams} from '../uri.js'; * @property {ol.source.WMTSRequestEncoding|string} [requestEncoding='KVP'] Request encoding. * @property {string} layer Layer name as advertised in the WMTS capabilities. * @property {string} style Style name as advertised in the WMTS capabilities. - * @property {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, - * module:ol/TileState~TileState, string, ?string, - * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. Default is {@link module:ol/ImageTile~ImageTile}. + * @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles. Default is {@link module:ol/ImageTile~ImageTile}. * @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service. * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px * by 512px images (for retina/hidpi devices) then `tilePixelRatio` diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index 6551dfe72a..ce6a70b9f9 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -28,7 +28,7 @@ const TierSizeCalculation = { * @extends {module:ol/ImageTile~ImageTile} * @param {module:ol/tilegrid/TileGrid~TileGrid} tileGrid TileGrid that the tile belongs to. * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/TileState~TileState} state State. + * @param {module:ol/TileState} state State. * @param {string} src Image source URI. * @param {?string} crossOrigin Cross origin. * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. From c23a5086ae546a1db5afccabd863012dcc5fd6c1 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sat, 21 Apr 2018 10:48:38 +0200 Subject: [PATCH 2/3] Fix enum types --- src/ol/Collection.js | 2 +- src/ol/Graticule.js | 2 +- src/ol/Map.js | 4 ++-- src/ol/PluggableMap.js | 4 ++-- src/ol/WebGLMap.js | 4 ++-- src/ol/format/EsriJSON.js | 4 ++-- src/ol/format/Feature.js | 2 +- src/ol/format/MVT.js | 8 ++++---- src/ol/geom/Geometry.js | 3 ++- src/ol/interaction/Draw.js | 8 ++++---- src/ol/interaction/Extent.js | 4 ++-- src/ol/layer/Base.js | 4 ++-- src/ol/layer/Image.js | 2 +- src/ol/layer/Tile.js | 2 +- src/ol/layer/Vector.js | 22 +++++++++++++++++++--- src/ol/layer/VectorTile.js | 26 +++++++++++++++++++++++--- src/ol/render/Feature.js | 6 +++--- src/ol/renderer/vector.js | 2 +- src/ol/style/Style.js | 4 ++-- src/ol/style/index.jsdoc | 24 ++++++++++++------------ 20 files changed, 87 insertions(+), 50 deletions(-) diff --git a/src/ol/Collection.js b/src/ol/Collection.js index 8b4f31b85f..925378b5d9 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -25,7 +25,7 @@ const Property = { * @constructor * @extends {module:ol/events/Event~Event} * @implements {oli.CollectionEvent} - * @param {module:ol/CollectionEventType~CollectionEventType} type Type. + * @param {module:ol/CollectionEventType} type Type. * @param {*=} opt_element Element. */ export const CollectionEvent = function(type, opt_element) { diff --git a/src/ol/Graticule.js b/src/ol/Graticule.js index 04a81353b3..45ee3d5049 100644 --- a/src/ol/Graticule.js +++ b/src/ol/Graticule.js @@ -605,7 +605,7 @@ Graticule.prototype.getParallels = function() { /** - * @param {module:ol/render/Event~Event} e Event. + * @param {module:ol/render/Event~RenderEvent} e Event. * @private */ Graticule.prototype.handlePostCompose_ = function(e) { diff --git a/src/ol/Map.js b/src/ol/Map.js index fd1d3ec049..4635894e78 100644 --- a/src/ol/Map.js +++ b/src/ol/Map.js @@ -62,8 +62,8 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js' * @param {module:ol/PluggableMap~MapOptions} options Map options. * @fires module:ol/MapBrowserEvent~MapBrowserEvent * @fires module:ol/MapEvent~MapEvent - * @fires module:ol/render/Event~Event#postcompose - * @fires module:ol/render/Event~Event#precompose + * @fires module:ol/render/Event~RenderEvent#postcompose + * @fires module:ol/render/Event~RenderEvent#precompose * @api */ const Map = function(options) { diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 8c4b285034..9f98df2b52 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -136,8 +136,8 @@ import {create as createTransform, apply as applyTransform} from './transform.js * @param {module:ol/PluggableMap~MapOptions} options Map options. * @fires module:ol/MapBrowserEvent~MapBrowserEvent * @fires module:ol/MapEvent~MapEvent - * @fires module:ol/render/Event~Event#postcompose - * @fires module:ol/render/Event~Event#precompose + * @fires module:ol/render/Event~RenderEvent#postcompose + * @fires module:ol/render/Event~RenderEvent#precompose * @api */ const PluggableMap = function(options) { diff --git a/src/ol/WebGLMap.js b/src/ol/WebGLMap.js index 1da33acb01..ec5550c3df 100644 --- a/src/ol/WebGLMap.js +++ b/src/ol/WebGLMap.js @@ -62,8 +62,8 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js'; * @param {module:ol/PluggableMap~MapOptions} options Map options. * @fires module:ol/MapBrowserEvent~MapBrowserEvent * @fires module:ol/MapEvent~MapEvent - * @fires module:ol/render/Event~Event#postcompose - * @fires module:ol/render/Event~Event#precompose + * @fires module:ol/render/Event~RenderEvent#postcompose + * @fires module:ol/render/Event~RenderEvent#precompose * @api */ const WebGLMap = function(options) { diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js index 41b276c6b6..b0cbed33cf 100644 --- a/src/ol/format/EsriJSON.js +++ b/src/ol/format/EsriJSON.js @@ -24,7 +24,7 @@ import {get as getProjection} from '../proj.js'; /** * @const - * @type {Object.} + * @type {Object.} */ const GEOMETRY_READERS = {}; GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry; @@ -90,7 +90,7 @@ function readGeometry(object, opt_options) { if (!object) { return null; } - /** @type {module:ol/geom/GeometryType~GeometryType} */ + /** @type {module:ol/geom/GeometryType} */ let type; if (typeof object.x === 'number' && typeof object.y === 'number') { type = GeometryType.POINT; diff --git a/src/ol/format/Feature.js b/src/ol/format/Feature.js index 13012fb597..4fdb7216ed 100644 --- a/src/ol/format/Feature.js +++ b/src/ol/format/Feature.js @@ -125,7 +125,7 @@ FeatureFormat.prototype.getLastExtent = function() { /** * @abstract - * @return {module:ol/format/FormatType~FormatType} Format. + * @return {module:ol/format/FormatType} Format. */ FeatureFormat.prototype.getType = function() {}; diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index 1bbaf18ffd..d032bc3a0a 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -24,7 +24,7 @@ import RenderFeature from '../render/Feature.js'; /** * @typedef {Object} Options - * @property {function((module:ol/geom/Geometry~Geometry|Object.)=)|function(module:ol/geom/GeometryType~GeometryType,Array.,(Array.|Array.>),Object.,number)} [featureClass] + * @property {function((module:ol/geom/Geometry~Geometry|Object.)=)|function(module:ol/geom/GeometryType,Array.,(Array.|Array.>),Object.,number)} [featureClass] * Class for features returned by {@link ol.format.MVT#readFeatures}. Set to * {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of * decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature}, @@ -64,7 +64,7 @@ const MVT = function(opt_options) { /** * @private * @type {function((module:ol/geom/Geometry~Geometry|Object.)=)| - * function(module:ol/geom/GeometryType~GeometryType,Array., + * function(module:ol/geom/GeometryType,Array., * (Array.|Array.>),Object.,number)} */ this.featureClass_ = options.featureClass ? @@ -272,10 +272,10 @@ MVT.prototype.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) { * @param {number} type The raw feature's geometry type * @param {number} numEnds Number of ends of the flat coordinates of the * geometry. - * @return {module:ol/geom/GeometryType~GeometryType} The geometry type. + * @return {module:ol/geom/GeometryType} The geometry type. */ function getGeometryType(type, numEnds) { - /** @type {module:ol/geom/GeometryType~GeometryType} */ + /** @type {module:ol/geom/GeometryType} */ let geometryType; if (type === 1) { geometryType = numEnds === 1 ? diff --git a/src/ol/geom/Geometry.js b/src/ol/geom/Geometry.js index e0d539141a..d63a366e0f 100644 --- a/src/ol/geom/Geometry.js +++ b/src/ol/geom/Geometry.js @@ -10,6 +10,7 @@ import {get as getProjection, getTransform} from '../proj.js'; import Units from '../proj/Units.js'; import {create as createTransform, compose as composeTransform} from '../transform.js'; + /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -203,7 +204,7 @@ Geometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {}; /** * Get the type of this geometry. * @abstract - * @return {module:ol/geom/GeometryType~GeometryType} Geometry type. + * @return {module:ol/geom/GeometryType} Geometry type. */ Geometry.prototype.getType = function() {}; diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index 977a0580f2..216ceb69f9 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -31,7 +31,7 @@ import {createEditingStyle} from '../style/Style.js'; /** * @typedef {Object} Options - * @property {module:ol/geom/GeometryType~GeometryType} type Geometry type of + * @property {module:ol/geom/GeometryType} type Geometry type of * the geometries being drawn with this instance. * @property {number} [clickTolerance=6] The maximum distance in pixels between * "down" and "up" for a "up" event to be considered a "click" event and @@ -222,10 +222,10 @@ const Draw = function(options) { /** * Geometry type. - * @type {module:ol/geom/GeometryType~GeometryType} + * @type {module:ol/geom/GeometryType} * @private */ - this.type_ = /** @type {module:ol/geom/GeometryType~GeometryType} */ (options.type); + this.type_ = /** @type {module:ol/geom/GeometryType} */ (options.type); /** * Drawing mode (derived from geometry type. @@ -1008,7 +1008,7 @@ export function createBox() { /** * Get the drawing mode. The mode for mult-part geometries is the same as for * their single-part cousins. - * @param {module:ol/geom/GeometryType~GeometryType} type Geometry type. + * @param {module:ol/geom/GeometryType} type Geometry type. * @return {module:ol/interaction/Draw~Mode} Drawing mode. */ function getMode(type) { diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index 210b460400..8698dcbae2 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -23,12 +23,12 @@ import {createEditingStyle} from '../style/Style.js'; * initial extent. * @property {module:ol/style/Style~Style|Array.|module:ol/style~StyleFunction} [boxStyle] * Style for the drawn extent box. Defaults to - * {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType~GeometryType.POLYGON]} + * {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType.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~Style|Array.|module:ol/style~StyleFunction} [pointerStyle] * Style for the cursor used to draw the extent. Defaults to - * {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType~GeometryType.POINT]} + * {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType.POINT]} * @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps * in the X direction? Only affects visuals, not functionality. */ diff --git a/src/ol/layer/Base.js b/src/ol/layer/Base.js index 8df8e18751..22d71798f4 100644 --- a/src/ol/layer/Base.js +++ b/src/ol/layer/Base.js @@ -69,7 +69,7 @@ const BaseLayer = function(options) { /** * The layer type. - * @type {module:ol/LayerType~LayerType} + * @type {module:ol/LayerType} * @protected; */ this.type; @@ -81,7 +81,7 @@ inherits(BaseLayer, BaseObject); /** * Get the layer type (used when creating a layer renderer). - * @return {module:ol/LayerType~LayerType} The layer type. + * @return {module:ol/LayerType} The layer type. */ BaseLayer.prototype.getType = function() { return this.type; diff --git a/src/ol/layer/Image.js b/src/ol/layer/Image.js index e8b3bfce86..a640c33d53 100644 --- a/src/ol/layer/Image.js +++ b/src/ol/layer/Image.js @@ -47,7 +47,7 @@ const ImageLayer = function(opt_options) { /** * The layer type. * @protected - * @type {module:ol/LayerType~LayerType} + * @type {module:ol/LayerType} */ this.type = LayerType.IMAGE; diff --git a/src/ol/layer/Tile.js b/src/ol/layer/Tile.js index 0453957d21..ca7b0db6f8 100644 --- a/src/ol/layer/Tile.js +++ b/src/ol/layer/Tile.js @@ -61,7 +61,7 @@ const TileLayer = function(opt_options) { /** * The layer type. * @protected - * @type {module:ol/LayerType~LayerType} + * @type {module:ol/LayerType} */ this.type = LayerType.TILE; diff --git a/src/ol/layer/Vector.js b/src/ol/layer/Vector.js index 5dbc24e1e2..8917b6bfba 100644 --- a/src/ol/layer/Vector.js +++ b/src/ol/layer/Vector.js @@ -27,7 +27,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style. * @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the * renderer when getting features from the vector source for the rendering or hit-detection. * Recommended value: the size of the largest symbol, line width or label. - * @property {module:ol/layer/VectorRenderType~VectorRenderType|string} [renderMode='vector'] Render mode for vector layers: + * @property {module:ol/layer/VectorRenderType|string} [renderMode='vector'] Render mode for vector layers: * * `'image'`: Vector layers are rendered as images. Great performance, but point symbols and * texts are always rotated with the view and pixels are scaled during zoom animations. * * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during @@ -52,6 +52,22 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style. */ +/** + * @enum {string} + * Render mode for vector layers: + * * `'image'`: Vector layers are rendered as images. Great performance, but + * point symbols and texts are always rotated with the view and pixels are + * scaled during zoom animations. + * * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering + * even during animations, but slower performance. + * @api + */ +export const RenderType = { + IMAGE: 'image', + VECTOR: 'vector' +}; + + /** * @enum {string} * @private @@ -138,7 +154,7 @@ const VectorLayer = function(opt_options) { /** * The layer type. * @protected - * @type {module:ol/LayerType~LayerType} + * @type {module:ol/LayerType} */ this.type = LayerType.VECTOR; @@ -258,7 +274,7 @@ VectorLayer.prototype.setStyle = function(style) { /** - * @return {module:ol/layer/VectorRenderType~VectorRenderType|string} The render mode. + * @return {module:ol/layer/VectorRenderType|string} The render mode. */ VectorLayer.prototype.getRenderMode = function() { return this.renderMode_; diff --git a/src/ol/layer/VectorTile.js b/src/ol/layer/VectorTile.js index e7c663cb4c..1ff3e74bc1 100644 --- a/src/ol/layer/VectorTile.js +++ b/src/ol/layer/VectorTile.js @@ -10,6 +10,26 @@ import VectorTileRenderType from '../layer/VectorTileRenderType.js'; import {assign} from '../obj.js'; +/** + * @enum {string} + * Render mode for vector tiles: + * * `'image'`: Vector tiles are rendered as images. Great performance, but + * point symbols and texts are always rotated with the view and pixels are + * scaled during zoom animations. + * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels + * are scaled during zoom animations. Point symbols and texts are accurately + * rendered as vectors and can stay upright on rotated views. + * * `'vector'`: Vector tiles are rendered as vectors. Most accurate rendering + * even during animations, but slower performance than the other options. + * @api + */ +export const RenderType = { + IMAGE: 'image', + HYBRID: 'hybrid', + VECTOR: 'vector' +}; + + /** * @typedef {Object} Options * @property {number} [opacity=1] Opacity (0, 1). @@ -30,7 +50,7 @@ import {assign} from '../obj.js'; * Recommended value: Vector tiles are usually generated with a buffer, so this value should match * the largest possible buffer of the used tiles. It should be at least the size of the largest * point symbol or line width. - * @property {module:ol/layer/VectorRenderType~VectorRenderType|string} [renderMode='hybrid'] Render mode for vector tiles: + * @property {module:ol/layer/VectorTileRenderType|string} [renderMode='hybrid'] Render mode for vector tiles: * * `'image'`: Vector tiles are rendered as images. Great performance, but point symbols and texts * are always rotated with the view and pixels are scaled during zoom animations. * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom @@ -71,7 +91,7 @@ import {assign} from '../obj.js'; /** * @classdesc * Layer for vector tile data that is rendered client-side. - * Note that any property set in the options is set as a {@link } + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * @@ -107,7 +127,7 @@ const VectorTileLayer = function(opt_options) { /** * The layer type. * @protected - * @type {module:ol/LayerType~LayerType} + * @type {module:ol/LayerType} */ this.type = LayerType.VECTOR_TILE; diff --git a/src/ol/render/Feature.js b/src/ol/render/Feature.js index ba5e41f16f..0f5a9fbb68 100644 --- a/src/ol/render/Feature.js +++ b/src/ol/render/Feature.js @@ -17,7 +17,7 @@ import {create as createTransform, compose as composeTransform} from '../transfo * through the API is limited to getting the type and extent of the geometry. * * @constructor - * @param {module:ol/geom/GeometryType~GeometryType} type Geometry type. + * @param {module:ol/geom/GeometryType} type Geometry type. * @param {Array.} flatCoordinates Flat coordinates. These always need * to be right-handed for polygons. * @param {Array.|Array.>} ends Ends or Endss. @@ -39,7 +39,7 @@ const RenderFeature = function(type, flatCoordinates, ends, properties, id) { /** * @private - * @type {module:ol/geom/GeometryType~GeometryType} + * @type {module:ol/geom/GeometryType} */ this.type_ = type; @@ -249,7 +249,7 @@ RenderFeature.prototype.getStyleFunction = UNDEFINED; /** * Get the type of this feature's geometry. - * @return {module:ol/geom/GeometryType~GeometryType} Geometry type. + * @return {module:ol/geom/GeometryType} Geometry type. * @api */ RenderFeature.prototype.getType = function() { diff --git a/src/ol/renderer/vector.js b/src/ol/renderer/vector.js index a0940c07a5..dfa83936d6 100644 --- a/src/ol/renderer/vector.js +++ b/src/ol/renderer/vector.js @@ -16,7 +16,7 @@ const SIMPLIFY_TOLERANCE = 0.5; /** * @const - * @type {Object.} */ diff --git a/src/ol/style/Style.js b/src/ol/style/Style.js index 90dec90da1..8c90cf9f20 100644 --- a/src/ol/style/Style.js +++ b/src/ol/style/Style.js @@ -380,10 +380,10 @@ export function createDefaultStyle(feature, resolution) { /** * Default styles for editing features. - * @return {Object.>} Styles + * @return {Object.>} Styles */ export function createEditingStyle() { - /** @type {Object.>} */ + /** @type {Object.>} */ const styles = {}; const white = [255, 255, 255, 1]; const blue = [0, 153, 255, 1]; diff --git a/src/ol/style/index.jsdoc b/src/ol/style/index.jsdoc index ab82a9c7ec..160365d9fc 100644 --- a/src/ol/style/index.jsdoc +++ b/src/ol/style/index.jsdoc @@ -28,16 +28,16 @@ * var white = [255, 255, 255, 1]; * var blue = [0, 153, 255, 1]; * var width = 3; - * styles[module:ol/geom/GeometryType~GeometryType.POLYGON] = [ + * styles[module:ol/geom/GeometryType.POLYGON] = [ * new ol.style.Style({ * fill: new ol.style.Fill({ * color: [255, 255, 255, 0.5] * }) * }) * ]; - * styles[module:ol/geom/GeometryType~GeometryType.MULTI_POLYGON] = - * styles[module:ol/geom/GeometryType~GeometryType.POLYGON]; - * styles[module:ol/geom/GeometryType~GeometryType.LINE_STRING] = [ + * styles[module:ol/geom/GeometryType.MULTI_POLYGON] = + * styles[module:ol/geom/GeometryType.POLYGON]; + * styles[module:ol/geom/GeometryType.LINE_STRING] = [ * new ol.style.Style({ * stroke: new ol.style.Stroke({ * color: white, @@ -51,9 +51,9 @@ * }) * }) * ]; - * styles[module:ol/geom/GeometryType~GeometryType.MULTI_LINE_STRING] = - * styles[module:ol/geom/GeometryType~GeometryType.LINE_STRING]; - * styles[module:ol/geom/GeometryType~GeometryType.POINT] = [ + * styles[module:ol/geom/GeometryType.MULTI_LINE_STRING] = + * styles[module:ol/geom/GeometryType.LINE_STRING]; + * styles[module:ol/geom/GeometryType.POINT] = [ * new ol.style.Style({ * image: new ol.style.Circle({ * radius: width * 2, @@ -68,11 +68,11 @@ * zIndex: Infinity * }) * ]; - * styles[module:ol/geom/GeometryType~GeometryType.MULTI_POINT] = - * styles[module:ol/geom/GeometryType~GeometryType.POINT]; - * styles[module:ol/geom/GeometryType~GeometryType.GEOMETRY_COLLECTION] = - * styles[module:ol/geom/GeometryType~GeometryType.POLYGON].concat( - * styles[module:ol/geom/GeometryType~GeometryType.POINT] + * styles[module:ol/geom/GeometryType.MULTI_POINT] = + * styles[module:ol/geom/GeometryType.POINT]; + * styles[module:ol/geom/GeometryType.GEOMETRY_COLLECTION] = + * styles[module:ol/geom/GeometryType.POLYGON].concat( + * styles[module:ol/geom/GeometryType.POINT] * ); *``` * From d7f3e633b7e928a381d519bee4966f9ac37966db Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 23 Apr 2018 08:32:40 +0200 Subject: [PATCH 3/3] Fix code snippet JavaScript --- src/ol/interaction/Extent.js | 4 ++-- src/ol/style/index.jsdoc | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index 8698dcbae2..2b95e1f5be 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -23,12 +23,12 @@ import {createEditingStyle} from '../style/Style.js'; * initial extent. * @property {module:ol/style/Style~Style|Array.|module:ol/style~StyleFunction} [boxStyle] * Style for the drawn extent box. Defaults to - * {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType.POLYGON]} + * {@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~Style|Array.|module:ol/style~StyleFunction} [pointerStyle] * Style for the cursor used to draw the extent. Defaults to - * {@link module:ol/style/Style~createEditing()[module:ol/geom/GeometryType.POINT]} + * {@link module:ol/style/Style~createEditing()['Point']} * @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps * in the X direction? Only affects visuals, not functionality. */ diff --git a/src/ol/style/index.jsdoc b/src/ol/style/index.jsdoc index 160365d9fc..39f6db8644 100644 --- a/src/ol/style/index.jsdoc +++ b/src/ol/style/index.jsdoc @@ -25,19 +25,20 @@ * * A separate editing style has the following defaults: * ```js + * import GeometryType from ol/geom/GeometryType * var white = [255, 255, 255, 1]; * var blue = [0, 153, 255, 1]; * var width = 3; - * styles[module:ol/geom/GeometryType.POLYGON] = [ + * styles[GeometryType.POLYGON] = [ * new ol.style.Style({ * fill: new ol.style.Fill({ * color: [255, 255, 255, 0.5] * }) * }) * ]; - * styles[module:ol/geom/GeometryType.MULTI_POLYGON] = - * styles[module:ol/geom/GeometryType.POLYGON]; - * styles[module:ol/geom/GeometryType.LINE_STRING] = [ + * styles[GeometryType.MULTI_POLYGON] = + * styles[GeometryType.POLYGON]; + * styles[GeometryType.LINE_STRING] = [ * new ol.style.Style({ * stroke: new ol.style.Stroke({ * color: white, @@ -51,9 +52,9 @@ * }) * }) * ]; - * styles[module:ol/geom/GeometryType.MULTI_LINE_STRING] = - * styles[module:ol/geom/GeometryType.LINE_STRING]; - * styles[module:ol/geom/GeometryType.POINT] = [ + * styles[GeometryType.MULTI_LINE_STRING] = + * styles[GeometryType.LINE_STRING]; + * styles[GeometryType.POINT] = [ * new ol.style.Style({ * image: new ol.style.Circle({ * radius: width * 2, @@ -68,11 +69,11 @@ * zIndex: Infinity * }) * ]; - * styles[module:ol/geom/GeometryType.MULTI_POINT] = - * styles[module:ol/geom/GeometryType.POINT]; - * styles[module:ol/geom/GeometryType.GEOMETRY_COLLECTION] = - * styles[module:ol/geom/GeometryType.POLYGON].concat( - * styles[module:ol/geom/GeometryType.POINT] + * styles[GeometryType.MULTI_POINT] = + * styles[GeometryType.POINT]; + * styles[GEOMETRY_COLLECTION] = + * styles[GeometryType.POLYGON].concat( + * styles[GeometryType.POINT] * ); *``` *