From cd2f0f60d609e59f2687180213d54b9be96f8fb1 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 23 Oct 2018 17:40:51 +0200 Subject: [PATCH 1/7] Make link texts consistent with docs --- config/jsdoc/api/index.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/jsdoc/api/index.md b/config/jsdoc/api/index.md index 4817f900f6..0eb4a286c6 100644 --- a/config/jsdoc/api/index.md +++ b/config/jsdoc/api/index.md @@ -8,10 +8,10 @@

The view manages the visual parameters of the map view, like resolution or rotation.

[View](module-ol_View-View.html) with center, projection, resolution and rotation

Layers are lightweight containers that get their data from [sources](module-ol_source_Source-Source.html).

-[layer/Tile](module-ol_layer_Tile-TileLayer.html)
-[layer/Image](module-ol_layer_Image-ImageLayer.html)
-[layer/Vector](module-ol_layer_Vector-VectorLayer.html)
-[layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html) +[ol/layer/Tile](module-ol_layer_Tile-TileLayer.html)
+[ol/layer/Image](module-ol_layer_Image-ImageLayer.html)
+[ol/layer/Vector](module-ol_layer_Vector-VectorLayer.html)
+[ol/layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html) ControlsInteractionsSources and formats @@ -21,18 +21,18 @@ [Map default interactions](module-ol_interaction.html#~defaults)
Interactions for [vector features](module-ol_Feature-Feature.html) - + [All interactions](module-ol_interaction_Interaction-Interaction.html) -[Tile sources](module-ol_source_Tile-TileSource.html) for [layer/Tile](module-ol_layer_Tile-TileLayer.html) -
[Image sources](module-ol_source_Image-ImageSource.html) for [layer/Image](module-ol_layer_Image-ImageLayer.html) -
[Vector sources](module-ol_source_Vector-VectorSource.html) for [layer/Vector](module-ol_layer_Vector-VectorLayer.html) -
[Vector tile sources](module-ol_source_VectorTile-VectorTile.html) for [layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html) +[Tile sources](module-ol_source_Tile-TileSource.html) for [ol/layer/Tile](module-ol_layer_Tile-TileLayer.html) +
[Image sources](module-ol_source_Image-ImageSource.html) for [ol/layer/Image](module-ol_layer_Image-ImageLayer.html) +
[Vector sources](module-ol_source_Vector-VectorSource.html) for [ol/layer/Vector](module-ol_layer_Vector-VectorLayer.html) +
[Vector tile sources](module-ol_source_VectorTile-VectorTile.html) for [ol/layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)
[Formats](module-ol_format_Feature-FeatureFormat.html) for reading/writing vector data -
[format/WMSCapabilities](module-ol_format_WMSCapabilities-WMSCapabilities.html) +
[ol/format/WMSCapabilities](module-ol_format_WMSCapabilities-WMSCapabilities.html) ProjectionsObservable objectsOther components -

All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [proj.transform()](module-ol_proj.html#.transform) and [proj.transformExtent()](module-ol_proj.html#.transformExtent).

+

All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol/proj#transform()](module-ol_proj.html#.transform) and [ol/proj#transformExtent()](module-ol_proj.html#.transformExtent).

[ol/proj](module-ol_proj.html)

Changes to all [ol/Object](module-ol_Object-BaseObject.html)s can be observed by calling the [object.on('propertychange')](module-ol_Object-BaseObject.html#on) method. Listeners receive an [ol/Object~ObjectEvent](module-ol_Object-ObjectEvent.html) with information on the changed property and old value.

From d1395d005cc3748253553d5e8da7fc9ea5c0fb2b Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 23 Oct 2018 17:58:50 +0200 Subject: [PATCH 2/7] Fix comments for JSDoc --- src/ol/Collection.js | 2 ++ src/ol/PluggableMap.js | 2 +- src/ol/TileState.js | 1 - src/ol/events.js | 2 +- src/ol/format/WKT.js | 1 + src/ol/geom/SimpleGeometry.js | 2 +- src/ol/pixel.js | 4 ++++ src/ol/source/UrlTile.js | 2 +- src/ol/util.js | 1 + 9 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ol/Collection.js b/src/ol/Collection.js index c2ae8689ad..5e0630f957 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -56,6 +56,8 @@ export class CollectionEvent extends Event { * Collection; they trigger events on the appropriate object, not on the * Collection as a whole. * + * @fires CollectionEvent + * * @template T * @api */ diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 1a6690038f..b4aa1e6ffb 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -88,7 +88,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js * @typedef {Object} MapOptions * @property {Collection|Array} [controls] * Controls initially added to the map. If not specified, - * {@link module:ol/control/util~defaults} is used. + * {@link module:ol/control~defaults} is used. * @property {number} [pixelRatio=window.devicePixelRatio] The ratio between * physical pixels and device-independent pixels (dips) on the device. * @property {Collection|Array} [interactions] diff --git a/src/ol/TileState.js b/src/ol/TileState.js index 0569b0c02d..f350815140 100644 --- a/src/ol/TileState.js +++ b/src/ol/TileState.js @@ -12,7 +12,6 @@ export default { /** * Indicates that tile loading failed * @type {number} - * @api */ ERROR: 3, EMPTY: 4, diff --git a/src/ol/events.js b/src/ol/events.js index a559532a64..bb9a7d425e 100644 --- a/src/ol/events.js +++ b/src/ol/events.js @@ -22,7 +22,7 @@ import {clear} from './obj.js'; * Listener function. This function is called with an event object as argument. * When the function returns `false`, event propagation will stop. * - * @typedef {function(Event|import("./events/Event.js").default): (void|boolean)} ListenerFunction + * @typedef {function((Event|import("./events/Event.js").default)): (void|boolean)} ListenerFunction * @api */ diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index eb390212f8..9ac6e212ce 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -16,6 +16,7 @@ import Polygon from '../geom/Polygon.js'; /** + * Geometry constructors * @enum {function (new:import("../geom/Geometry.js").default, Array, GeometryLayout)} */ const GeometryConstructor = { diff --git a/src/ol/geom/SimpleGeometry.js b/src/ol/geom/SimpleGeometry.js index f3210b7015..055be375b2 100644 --- a/src/ol/geom/SimpleGeometry.js +++ b/src/ol/geom/SimpleGeometry.js @@ -80,7 +80,7 @@ class SimpleGeometry extends Geometry { } /** - * Return the {@link module:ol/geom/GeometryLayout~GeometryLayout layout} of the geometry. + * Return the {@link module:ol/geom/GeometryLayout layout} of the geometry. * @return {GeometryLayout} Layout. * @api */ diff --git a/src/ol/pixel.js b/src/ol/pixel.js index 3d7292a906..1f7336022b 100644 --- a/src/ol/pixel.js +++ b/src/ol/pixel.js @@ -1,3 +1,7 @@ +/** + * @module ol/pixel + */ + /** * An array with two elements, representing a pixel. The first element is the * x-coordinate, the second the y-coordinate of the pixel. diff --git a/src/ol/source/UrlTile.js b/src/ol/source/UrlTile.js index 74859e738a..e8f251e407 100644 --- a/src/ol/source/UrlTile.js +++ b/src/ol/source/UrlTile.js @@ -31,7 +31,7 @@ import {getKeyZXY} from '../tilecoord.js'; * @classdesc * Base class for sources providing tiles divided into a tile grid over http. * - * @fires import("./TileEvent.js").default + * @fires import("./Tile.js").TileSourceEvent */ class UrlTile extends TileSource { /** diff --git a/src/ol/util.js b/src/ol/util.js index 2ba6870916..7b580fd926 100644 --- a/src/ol/util.js +++ b/src/ol/util.js @@ -44,6 +44,7 @@ let uidCounter_ = 0; * * @param {Object} obj The object to get the unique ID for. * @return {string} The unique ID for the object. + * @function module:ol.getUid * @api */ export function getUid(obj) { From 0b21d1a6fcf5fdb719abe28e441289635dacc048 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 23 Oct 2018 18:01:46 +0200 Subject: [PATCH 3/7] Document anonymous default exports --- config/jsdoc/api/plugins/api.js | 3 +++ config/jsdoc/api/template/tmpl/members.tmpl | 6 +++--- config/jsdoc/api/template/tmpl/navigation.tmpl | 11 +++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/config/jsdoc/api/plugins/api.js b/config/jsdoc/api/plugins/api.js index eab6a0bf94..0f1788dba8 100644 --- a/config/jsdoc/api/plugins/api.js +++ b/config/jsdoc/api/plugins/api.js @@ -106,6 +106,9 @@ exports.handlers = { if (doclet.kind == 'class') { modules[doclet.longname.split('~').shift()] = true; classes[doclet.longname] = doclet; + if (doclet.name === doclet.longname && !doclet.memberof) { + // Make sure anonymous default exports are documented + doclet.setMemberof(doclet.longname); } }, diff --git a/config/jsdoc/api/template/tmpl/members.tmpl b/config/jsdoc/api/template/tmpl/members.tmpl index 280556e3a5..243e1f22cd 100644 --- a/config/jsdoc/api/template/tmpl/members.tmpl +++ b/config/jsdoc/api/template/tmpl/members.tmpl @@ -14,7 +14,7 @@ if (data.type && data.type.names) {

- +

@@ -28,9 +28,9 @@ if (data.type && data.type.names) { - + - +
Example 1? 's':'' ?>
diff --git a/config/jsdoc/api/template/tmpl/navigation.tmpl b/config/jsdoc/api/template/tmpl/navigation.tmpl index f57d604640..cfa91d196a 100644 --- a/config/jsdoc/api/template/tmpl/navigation.tmpl +++ b/config/jsdoc/api/template/tmpl/navigation.tmpl @@ -1,5 +1,8 @@