From 48c28540cb841f9f5e13d3a602ea2e3d8a68b613 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 16:02:46 +0100 Subject: [PATCH 1/9] Module type for ol.ImageCanvas --- src/ol/source/ImageCanvas.js | 2 +- src/ol/source/Raster.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/source/ImageCanvas.js b/src/ol/source/ImageCanvas.js index 95a9a694bd..7ef9dd4960 100644 --- a/src/ol/source/ImageCanvas.js +++ b/src/ol/source/ImageCanvas.js @@ -32,7 +32,7 @@ const ImageCanvasSource = function(options) { /** * @private - * @type {ol.ImageCanvas} + * @type {module:ol/ImageCanvas~ImageCanvas} */ this.canvas_ = null; diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index 7425236340..19f99f7493 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -152,7 +152,7 @@ const RasterSource = function(options) { /** * The most recently rendered image canvas. - * @type {ol.ImageCanvas} + * @type {module:ol/ImageCanvas~ImageCanvas} * @private */ this.renderedImageCanvas_ = null; From a3ccfbdd44fe5e697639c9acd20452a39df251fa Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 16:03:59 +0100 Subject: [PATCH 2/9] Module type for ol.ImageTile --- src/ol/source/TileImage.js | 4 ++-- src/ol/source/Zoomify.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index f4c5dada73..73a9d1cce8 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -53,7 +53,7 @@ const TileImage = function(options) { /** * @protected - * @type {function(new: ol.ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, + * @type {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, * ?string, module:ol/Tile~LoadFunction, module:ol/Tile~Options=)} */ this.tileClass = options.tileClass !== undefined ? @@ -361,7 +361,7 @@ TileImage.prototype.setTileGridForProjection = function(projection, tilegrid) { /** - * @param {ol.ImageTile} imageTile Image tile. + * @param {module:ol/ImageTile~ImageTile} imageTile Image tile. * @param {string} src Source. */ function defaultTileLoadFunction(imageTile, src) { diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index b2c1d2c391..0f4cb01845 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -25,7 +25,7 @@ const TierSizeCalculation = { /** * @constructor - * @extends {ol.ImageTile} + * @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. From 5173970f53ebe4ea2014f425cc478d496f5ace21 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 16:07:09 +0100 Subject: [PATCH 3/9] Module type for ol.Image --- src/ol/renderer/Layer.js | 2 +- src/ol/source/Image.js | 10 +++++----- src/ol/source/ImageArcGISRest.js | 2 +- src/ol/source/ImageMapGuide.js | 2 +- src/ol/source/ImageStatic.js | 2 +- src/ol/source/ImageWMS.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ol/renderer/Layer.js b/src/ol/renderer/Layer.js index 048261bb79..487afaf030 100644 --- a/src/ol/renderer/Layer.js +++ b/src/ol/renderer/Layer.js @@ -95,7 +95,7 @@ LayerRenderer.prototype.getLayer = function() { * @private */ LayerRenderer.prototype.handleImageChange_ = function(event) { - const image = /** @type {ol.Image} */ (event.target); + const image = /** @type {module:ol/Image~Image} */ (event.target); if (image.getState() === ImageState.LOADED) { this.renderIfReadyAndVisible(); } diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index a7982bd5a7..2e8a0ec6ea 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -50,7 +50,7 @@ const ImageSourceEventType = { * @extends {module:ol/events/Event~Event} * @implements {oli.source.ImageEvent} * @param {string} type Type. - * @param {ol.Image} image The image. + * @param {module:ol/Image~Image} image The image. */ const ImageSourceEvent = function(type, image) { @@ -58,7 +58,7 @@ const ImageSourceEvent = function(type, image) { /** * The image related to the event. - * @type {ol.Image} + * @type {module:ol/Image~Image} * @api */ this.image = image; @@ -196,7 +196,7 @@ ImageSource.prototype.getImageInternal = function(extent, resolution, pixelRatio * @protected */ ImageSource.prototype.handleImageChange = function(event) { - const image = /** @type {ol.Image} */ (event.target); + const image = /** @type {module:ol/Image~Image} */ (event.target); switch (image.getState()) { case ImageState.LOADING: this.dispatchEvent( @@ -220,9 +220,9 @@ ImageSource.prototype.handleImageChange = function(event) { /** - * Default image load function for image sources that use ol.Image image + * Default image load function for image sources that use module:ol/Image~Image image * instances. - * @param {ol.Image} image Image. + * @param {module:ol/Image~Image} image Image. * @param {string} src Source. */ export function defaultImageLoadFunction(image, src) { diff --git a/src/ol/source/ImageArcGISRest.js b/src/ol/source/ImageArcGISRest.js index 3b4b968ab7..812d1607ae 100644 --- a/src/ol/source/ImageArcGISRest.js +++ b/src/ol/source/ImageArcGISRest.js @@ -71,7 +71,7 @@ const ImageArcGISRest = function(opt_options) { /** * @private - * @type {ol.Image} + * @type {module:ol/Image~Image} */ this.image_ = null; diff --git a/src/ol/source/ImageMapGuide.js b/src/ol/source/ImageMapGuide.js index 5d4cc0c010..fb59f00210 100644 --- a/src/ol/source/ImageMapGuide.js +++ b/src/ol/source/ImageMapGuide.js @@ -88,7 +88,7 @@ const ImageMapGuide = function(options) { /** * @private - * @type {ol.Image} + * @type {module:ol/Image~Image} */ this.image_ = null; diff --git a/src/ol/source/ImageStatic.js b/src/ol/source/ImageStatic.js index b7b2ed442e..088acdbab6 100644 --- a/src/ol/source/ImageStatic.js +++ b/src/ol/source/ImageStatic.js @@ -37,7 +37,7 @@ const Static = function(options) { /** * @private - * @type {ol.Image} + * @type {module:ol/Image~Image} */ this.image_ = new ImageWrapper(imageExtent, undefined, 1, options.url, crossOrigin, imageLoadFunction); diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 2f783fb951..431ef1f71e 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -84,7 +84,7 @@ const ImageWMS = function(opt_options) { /** * @private - * @type {ol.Image} + * @type {module:ol/Image~Image} */ this.image_ = null; From 38eb1494eb1c61b949a2d768a1a080ab9affbc51 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 16:29:32 +0100 Subject: [PATCH 4/9] Module type for ol.CollectionEvent --- src/ol/CollectionEventType.js | 4 ++-- src/ol/layer/Group.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/CollectionEventType.js b/src/ol/CollectionEventType.js index 58ee49c827..0676fa4e2e 100644 --- a/src/ol/CollectionEventType.js +++ b/src/ol/CollectionEventType.js @@ -8,13 +8,13 @@ export default { /** * Triggered when an item is added to the collection. - * @event module:ol/CollectionEvent~CollectionEvent#add + * @event module:ol/Collection~CollectionEvent#add * @api */ ADD: 'add', /** * Triggered when an item is removed from the collection. - * @event module:ol/CollectionEvent~CollectionEvent#remove + * @event module:ol/Collection~CollectionEvent#remove * @api */ REMOVE: 'remove' diff --git a/src/ol/layer/Group.js b/src/ol/layer/Group.js index ee52d7acad..00b690e585 100644 --- a/src/ol/layer/Group.js +++ b/src/ol/layer/Group.js @@ -121,7 +121,7 @@ LayerGroup.prototype.handleLayersChanged_ = function(event) { /** - * @param {ol.CollectionEvent} collectionEvent CollectionEvent. + * @param {module:ol/Collection~CollectionEvent} collectionEvent CollectionEvent. * @private */ LayerGroup.prototype.handleLayersAdd_ = function(collectionEvent) { @@ -136,7 +136,7 @@ LayerGroup.prototype.handleLayersAdd_ = function(collectionEvent) { /** - * @param {ol.CollectionEvent} collectionEvent CollectionEvent. + * @param {module:ol/Collection~CollectionEvent} collectionEvent CollectionEvent. * @private */ LayerGroup.prototype.handleLayersRemove_ = function(collectionEvent) { From b26e370b5b1b544ad1f005fe4b0a36f15364b5e5 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 16:32:39 +0100 Subject: [PATCH 5/9] Module type for ol.Collection --- src/ol/control/Control.js | 2 +- src/ol/control/OverviewMap.js | 2 +- src/ol/layer/Group.js | 12 ++++++------ src/ol/source/Vector.js | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index 5509ae7e74..f1ab4a614b 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -39,7 +39,7 @@ import {listen, unlistenByKey} from '../events.js'; * * The main advantage of having this as a control rather than a simple separate * DOM element is that preventing propagation is handled for you. Controls - * will also be objects in a `ol.Collection`, so you can use their methods. + * will also be objects in a {@link module:ol/Collection~Collection}, so you can use their methods. * * You can also extend this base for your own control class. See * examples/custom-controls for an example of how to do this. diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 9e79f01dd9..11e9cd1de5 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -45,7 +45,7 @@ const MIN_RATIO = 0.1; * @property {boolean} [collapsible=true] Whether the control can be collapsed or not. * @property {string|Element} [label='ยป'] Text label to use for the collapsed * overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used. - * @property {Array.|ol.Collection.} [layers] + * @property {Array.|module:ol/Collection~Collection.} [layers] * Layers for the overview map. If not set, then all main map layers are used * instead. * @property {function(module:ol/MapEvent~MapEvent)} [render] Function called when the control diff --git a/src/ol/layer/Group.js b/src/ol/layer/Group.js index 00b690e585..1f854eab46 100644 --- a/src/ol/layer/Group.js +++ b/src/ol/layer/Group.js @@ -26,7 +26,7 @@ const Property = { /** * @classdesc - * A {@link ol.Collection} of layers that are handled together. + * A {@link module:ol/Collection~Collection} of layers that are handled together. * * A generic `change` event is triggered when the group/Collection changes. * @@ -149,22 +149,22 @@ LayerGroup.prototype.handleLayersRemove_ = function(collectionEvent) { /** - * Returns the {@link ol.Collection collection} of {@link ol.layer.Layer layers} + * Returns the {@link module:ol/Collection~Collection collection} of {@link ol.layer.Layer layers} * in this group. - * @return {!ol.Collection.} Collection of + * @return {!module:ol/Collection~Collection.} Collection of * {@link ol.layer.Base layers} that are part of this group. * @observable * @api */ LayerGroup.prototype.getLayers = function() { - return /** @type {!ol.Collection.} */ (this.get(Property.LAYERS)); + return /** @type {!module:ol/Collection~Collection.} */ (this.get(Property.LAYERS)); }; /** - * Set the {@link ol.Collection collection} of {@link ol.layer.Layer layers} + * Set the {@link module:ol/Collection~Collection collection} of {@link ol.layer.Layer layers} * in this group. - * @param {!ol.Collection.} layers Collection of + * @param {!module:ol/Collection~Collection.} layers Collection of * {@link ol.layer.Base layers} that are part of this group. * @observable * @api diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index ca4d115dc9..ddb9b51ce5 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -152,7 +152,7 @@ const VectorSource = function(opt_options) { /** * @private - * @type {ol.Collection.} + * @type {module:ol/Collection~Collection.} */ this.featuresCollection_ = null; @@ -316,7 +316,7 @@ VectorSource.prototype.addFeaturesInternal = function(features) { /** - * @param {!ol.Collection.} collection Collection. + * @param {!module:ol/Collection~Collection.} collection Collection. * @private */ VectorSource.prototype.bindFeaturesCollection_ = function(collection) { @@ -509,8 +509,8 @@ VectorSource.prototype.forEachFeatureIntersectingExtent = function(extent, callb /** * Get the features collection associated with this source. Will be `null` * unless the source was configured with `useSpatialIndex` set to `false`, or - * with an {@link ol.Collection} as `features`. - * @return {ol.Collection.} The collection of features. + * with an {@link module:ol/Collection~Collection} as `features`. + * @return {module:ol/Collection~Collection.} The collection of features. * @api */ VectorSource.prototype.getFeaturesCollection = function() { From 1eef986824a9a90a81eca6f1836d749574535827 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 16:59:01 +0100 Subject: [PATCH 6/9] Module type for ol.Observable --- src/ol/renderer/Layer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/renderer/Layer.js b/src/ol/renderer/Layer.js index 487afaf030..c4a999847d 100644 --- a/src/ol/renderer/Layer.js +++ b/src/ol/renderer/Layer.js @@ -12,7 +12,7 @@ import SourceState from '../source/State.js'; /** * @constructor - * @extends {ol.Observable} + * @extends {module:ol/Observable~Observable} * @param {ol.layer.Layer} layer Layer. * @struct */ From b6483a49c1961a532f1f409e4f12d5a8f87a6b56 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 17:02:58 +0100 Subject: [PATCH 7/9] Fix typedef name in jsdoc --- src/ol/colorlike.js | 6 +++--- src/ol/control.js | 6 +++--- src/ol/control/OverviewMap.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ol/colorlike.js b/src/ol/colorlike.js index 80c23e67fa..eb0b2d37cf 100644 --- a/src/ol/colorlike.js +++ b/src/ol/colorlike.js @@ -18,7 +18,7 @@ import {toString} from './color.js'; /** * @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color. - * @return {module:ol/color~ColorLike} The color as an {@link ol/color~ColorLike}. + * @return {module:ol/colorlike~ColorLike} The color as an {@link ol/colorlike~ColorLike}. * @api */ export function asColorLike(color) { @@ -31,8 +31,8 @@ export function asColorLike(color) { /** - * @param {?} color The value that is potentially an {@link ol/color~ColorLike}. - * @return {boolean} The color is an {@link ol/color~ColorLike}. + * @param {?} color The value that is potentially an {@link ol/colorlike~ColorLike}. + * @return {boolean} The color is an {@link ol/colorlike~ColorLike}. */ export function isColorLike(color) { return ( diff --git a/src/ol/control.js b/src/ol/control.js index 2f8fe9d746..79587b3d9b 100644 --- a/src/ol/control.js +++ b/src/ol/control.js @@ -11,14 +11,14 @@ import Zoom from './control/Zoom.js'; * @typedef {Object} DefaultsOptions * @property {boolean} [attribution=true] Include * {@link module:ol/control/Attribution~Attribution}. - * @property {module:ol/control/Attribution~AttributionOptions} [attributionOptions] + * @property {module:ol/control/Attribution~Options} [attributionOptions] * Options for {@link module:ol/control/Attribution~Attribution}. * @property {boolean} [rotate=true] Include * {@link module:ol/control/Rotate~Rotate}. - * @property {module:ol/control/Rotate~RotateOptions} [rotateOptions] Options + * @property {module:ol/control/Rotate~Options} [rotateOptions] Options * for {@link module:ol/control/Rotate~Rotate}. * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}. - * @property {module:ol/control/Zoom~ZoomOptions} [zoomOptions] Options for + * @property {module:ol/control/Zoom~Options} [zoomOptions] Options for * {@link module:ol/control/Zoom~Zoom}. * @api */ diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 11e9cd1de5..72958ea668 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -270,7 +270,7 @@ OverviewMap.prototype.setMap = function(map) { /** * Handle map property changes. This only deals with changes to the map's view. - * @param {module:ol/Object~BaseObject.Event} event The propertychange event. + * @param {module:ol/Object~ObjectEvent} event The propertychange event. * @private */ OverviewMap.prototype.handleMapPropertyChange_ = function(event) { From 7dc4d3a006bb9f7b44fcf69c18fa8f2f93a11361 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 17:09:11 +0100 Subject: [PATCH 8/9] Module type for ol.View --- src/ol/control/OverviewMap.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 72958ea668..221eebc897 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -53,7 +53,7 @@ const MIN_RATIO = 0.1; * @property {Element|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. * @property {string} [tipLabel='Overview map'] Text label to use for the button tip. - * @property {ol.View} [view] Custom view for the overview map. If not provided, + * @property {module:ol/View~View} [view] Custom view for the overview map. If not provided, * a default view with an EPSG:3857 projection will be used. */ @@ -275,7 +275,7 @@ OverviewMap.prototype.setMap = function(map) { */ OverviewMap.prototype.handleMapPropertyChange_ = function(event) { if (event.key === MapProperty.VIEW) { - const oldView = /** @type {ol.View} */ (event.oldValue); + const oldView = /** @type {module:ol/View~View} */ (event.oldValue); if (oldView) { this.unbindView_(oldView); } @@ -287,7 +287,7 @@ OverviewMap.prototype.handleMapPropertyChange_ = function(event) { /** * Register listeners for view property changes. - * @param {ol.View} view The view. + * @param {module:ol/View~View} view The view. * @private */ OverviewMap.prototype.bindView_ = function(view) { @@ -299,7 +299,7 @@ OverviewMap.prototype.bindView_ = function(view) { /** * Unregister listeners for view property changes. - * @param {ol.View} view The view. + * @param {module:ol/View~View} view The view. * @private */ OverviewMap.prototype.unbindView_ = function(view) { From cb6ecdb94b3fc8d32ebaccc192d168d255a8fdff Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 19 Mar 2018 17:27:25 +0100 Subject: [PATCH 9/9] Add missing undefined type to timout variables --- src/ol/interaction/Draw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index a7795bae57..1b0ca73603 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -182,13 +182,13 @@ const Draw = function(options) { this.downPx_ = null; /** - * @type {number} + * @type {number|undefined} * @private */ this.downTimeout_; /** - * @type {number} + * @type {number|undefined} * @private */ this.lastDragTime_;