From 6e88d3ba3cc0a1cbec728d3525c36edec0a96d34 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 4 Nov 2013 09:58:39 +0100 Subject: [PATCH] Minor apidoc updates --- src/objectliterals.jsdoc | 74 ++++++++++++++------------ src/ol/control/mousepositioncontrol.js | 4 +- src/ol/geolocation.js | 5 +- src/ol/geom/linearring.js | 2 +- src/ol/geom/linestring.js | 2 +- src/ol/geom/point.js | 2 +- src/ol/object.js | 14 ++--- src/ol/view2d.js | 6 +-- 8 files changed, 57 insertions(+), 52 deletions(-) diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 2d012d4677..289a531736 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -357,7 +357,7 @@ * modifier (i.e. Shift key) that determines if the interaction is active * or not, default is no modifiers. * @property {number|undefined} pixelDelta Pixel The amount to pan on each key - * press + * press. Default is `128` pixels. * @todo stability experimental */ @@ -367,7 +367,7 @@ * @property {ol.events.ConditionType|undefined} condition A conditional * modifier (i.e. Shift key) that determines if the interaction is active * or not, default is no modifiers. - * @property {number|undefined} delta The amount to zoom on each key press. + * @property {number|undefined} delta The amount to zoom on each key press. Default is `1`. * @todo stability experimental */ @@ -409,7 +409,8 @@ /** * @typedef {Object} ol.interaction.TouchRotateOptions - * @property {number|undefined} threshold Minimal angle to start a rotation. + * @property {number|undefined} threshold Minimal angle in radians to start a rotation. + * Default is `0.3`. * @todo stability experimental */ @@ -421,12 +422,12 @@ /** * @typedef {Object} ol.layer.BaseOptions - * @property {number|undefined} brightness Brightness. - * @property {number|undefined} contrast Contrast. - * @property {number|undefined} hue Hue. - * @property {number|undefined} opacity Opacity. - * @property {number|undefined} saturation Saturation. - * @property {boolean|undefined} visible Visibility. + * @property {number|undefined} brightness Brightness. Default is `0`. + * @property {number|undefined} contrast Contrast. Default is `1`. + * @property {number|undefined} hue Hue. Default is `0`. + * @property {number|undefined} opacity Opacity (0, 1). Default is `1`. + * @property {number|undefined} saturation Saturation. Default is `1`. + * @property {boolean|undefined} visible Visibility. Default is `true`. * @property {number|undefined} minResolution The minimum resolution * (inclusive) at which this layer will be visible. * @property {number|undefined} maxResolution The maximum resolution @@ -436,11 +437,11 @@ /** * @typedef {Object} ol.layer.LayerOptions - * @property {number|undefined} brightness Brightness. - * @property {number|undefined} contrast Contrast. - * @property {number|undefined} hue Hue. - * @property {number|undefined} opacity Opacity. 0-1. Default is `1`. - * @property {number|undefined} saturation Saturation. + * @property {number|undefined} brightness Brightness. Default is `0`. + * @property {number|undefined} contrast Contrast. Default is `1`. + * @property {number|undefined} hue Hue. Default is `0`. + * @property {number|undefined} opacity Opacity (0, 1). Default is `1`. + * @property {number|undefined} saturation Saturation. Default is `1`. * @property {ol.source.Source} source Source for this layer. * @property {boolean|undefined} visible Visibility. Default is `true` (visible). * @property {number|undefined} minResolution The minimum resolution @@ -452,12 +453,12 @@ /** * @typedef {Object} ol.layer.GroupOptions - * @property {number|undefined} brightness Brightness. - * @property {number|undefined} contrast Contrast. - * @property {number|undefined} hue Hue. - * @property {number|undefined} opacity Opacity. - * @property {number|undefined} saturation Saturation. - * @property {boolean|undefined} visible Visibility. + * @property {number|undefined} brightness Brightness. Default is `0`. + * @property {number|undefined} contrast Contrast. Default is `1`. + * @property {number|undefined} hue Hue. Default is `0`. + * @property {number|undefined} opacity Opacity (0, 1). Default is `1`. + * @property {number|undefined} saturation Saturation. Default is `1`. + * @property {boolean|undefined} visible Visibility. Default is `true`. * @property {number|undefined} minResolution The minimum resolution * (inclusive) at which this layer will be visible. * @property {number|undefined} maxResolution The maximum resolution @@ -468,12 +469,12 @@ /** * @typedef {Object} ol.layer.TileOptions - * @property {number|undefined} brightness Brightness. - * @property {number|undefined} contrast Contrast. - * @property {number|undefined} hue Hue. - * @property {number|undefined} opacity Opacity. 0-1. Default is `1`. + * @property {number|undefined} brightness Brightness. Default is `0`. + * @property {number|undefined} contrast Contrast. Default is `1`. + * @property {number|undefined} hue Hue. Default is `0`. + * @property {number|undefined} opacity Opacity (0, 1). Default is `1`. * @property {number|undefined} preload Preload. - * @property {number|undefined} saturation Saturation. + * @property {number|undefined} saturation Saturation. Default is `1`. * @property {ol.source.Source} source Source for this layer. * @property {boolean|undefined} visible Visibility. Default is `true` (visible). * @property {number|undefined} minResolution The minimum resolution @@ -489,7 +490,7 @@ * Function to render an array of * features into feature info markup. If not provided, a comma separated * list of the unique ids of the resulting features will be returned. - * @property {number|undefined} opacity Opacity. 0-1. Default is `1`. + * @property {number|undefined} opacity Opacity (0, 1). Default is `1`. * @property {ol.source.Source} source Source for this layer. * @property {ol.style.Style|undefined} style Style. * @property {boolean|undefined} visible Visibility. Default is `true` (visible). @@ -587,7 +588,7 @@ /** * @typedef {Object} ol.source.BingMapsOptions - * @property {string|undefined} culture Culture. + * @property {string|undefined} culture Culture code. Default is `en-us`. * @property {string} key Bing Maps API key. Get yours at * http://bingmapsportal.com/. * @property {string} imagerySet Type of imagery. @@ -617,7 +618,9 @@ * @property {number|undefined} maxZoom Max zoom. * @property {ol.TileLoadFunctionType|undefined} tileLoadFunction Optional * function to load a tile given a URL. - * @property {string|undefined} url URL. + * @property {string|undefined} url URL template. Must include `{x}`, `{y}`, + * and `{z}` placeholders. Default is + * `http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png`. * @todo stability experimental */ @@ -651,7 +654,8 @@ * @property {boolean|undefined} opaque Whether the layer is opaque. * @property {ol.TileLoadFunctionType|undefined} tileLoadFunction Optional * function to load a tile given a URL. - * @property {string|undefined} url URL. + * @property {string|undefined} url URL template. Must include `{x}`, `{y}`, + * and `{z}` placeholders. * @todo stability experimental */ @@ -674,7 +678,7 @@ * requests. * @property {ol.TileLoadFunctionType|undefined} tileLoadFunction Optional * function to load a tile given a URL. - * @property {string} url URL. + * @property {string} url URL to the TileJSON file. * @todo stability experimental */ @@ -761,7 +765,7 @@ * requests. * @property {ol.Extent|undefined} extent Extent. * @property {string|undefined} logo Logo. - * @property {ol.proj.ProjectionLike} projection Projection. + * @property {ol.proj.ProjectionLike} projection Projection. Default is `EPSG:3857`. * @property {number|undefined} maxZoom Optional max zoom level. Default is `18`. * @property {number|undefined} minZoom Unsupported (TODO: remove this). * @property {ol.TileLoadFunctionType|undefined} tileLoadFunction Optional @@ -783,7 +787,7 @@ * @property {number|ol.expr.Expression|undefined} height Height of the * icon in pixels. Default is the height of the icon image. * @property {number|ol.expr.Expression|undefined} opacity Icon opacity - * (0-1). + * (0, 1). Default is `1`. * @property {number|ol.expr.Expression|undefined} rotation Rotation in * radians (positive rotation clockwise). * @property {number|ol.expr.Expression|undefined} xOffset Pixel offset from the @@ -798,7 +802,7 @@ * @typedef {Object} ol.style.FillOptions * @property {string|ol.expr.Expression|undefined} color Fill color as hex color * code. - * @property {number|ol.expr.Expression|undefined} opacity Opacity (0-1). + * @property {number|ol.expr.Expression|undefined} opacity Opacity (0, 1). Default is `1`. * @property {number|ol.expr.Expression|undefined} zIndex Stack order. * @todo stability experimental */ @@ -830,7 +834,7 @@ * @typedef {Object} ol.style.StrokeOptions * @property {string|ol.expr.Expression|undefined} color Stroke color as hex * color code. - * @property {number|ol.expr.Expression|undefined} opacity Stroke opacity (0-1). + * @property {number|ol.expr.Expression|undefined} opacity Stroke opacity (0, 1). Default is `1`. * @property {number|ol.expr.Expression|undefined} width Stroke width in pixels. * @property {number|ol.expr.Expression|undefined} zIndex Stack order. * @todo stability experimental @@ -852,7 +856,7 @@ * @property {number|ol.expr.Expression|undefined} fontSize Font size in pixels. * @property {string|ol.expr.Expression|undefined} fontWeight Font weight. * @property {string|ol.expr.Expression} text Text for the label. - * @property {number|ol.expr.Expression|undefined} opacity Opacity (0-1). + * @property {number|ol.expr.Expression|undefined} opacity Opacity (0, 1). Default is `1`. * @property {ol.style.Stroke|undefined} stroke Stroke symbolizer for text. * @property {number|ol.expr.Expression|undefined} zIndex Stack order. * @todo stability experimental diff --git a/src/ol/control/mousepositioncontrol.js b/src/ol/control/mousepositioncontrol.js index a29e9a8ac3..3697e9f7b6 100644 --- a/src/ol/control/mousepositioncontrol.js +++ b/src/ol/control/mousepositioncontrol.js @@ -40,8 +40,8 @@ ol.control.MousePositionProperty = { * @todo stability experimental * @todo observable projection {ol.proj.Projection} the projection to report * mouse position in - * @todo observable coordinateFormat {string} the format to render the current - * position in + * @todo observable coordinateFormat {ol.CoordinateFormatType} the format to + * render the current position in */ ol.control.MousePosition = function(opt_options) { diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index 20058d73d1..884cac198d 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -62,8 +62,9 @@ ol.GeolocationProperty = { * @todo observable speed {number} readonly the instantaneous speed of the * device in meters per second * @todo observable tracking {number} track the device's position. - * @todo observable trackingOptions {number} PositionOptions as defined by the - * HTML5 Geolocation spec at http://dev.w3.org/geo/api/spec-source.html + * @todo observable trackingOptions {GeolocationPositionOptions} PositionOptions + * as defined by the HTML5 Geolocation spec at + * http://dev.w3.org/geo/api/spec-source.html */ ol.Geolocation = function(opt_options) { diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index 31f4ba200e..f2e0789b9b 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -10,7 +10,7 @@ goog.require('ol.geom.LineString'); * @constructor * @extends {ol.geom.LineString} * @param {ol.CoordinateArray} coordinates Vertex array (e.g. - * [[x0, y0], [x1, y1]]). + * `[[x0, y0], [x1, y1]]`). * @todo stability experimental */ ol.geom.LinearRing = function(coordinates) { diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index e7ed07843b..ec73a3669b 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -15,7 +15,7 @@ goog.require('ol.geom.GeometryType'); * @constructor * @extends {ol.geom.Geometry} * @param {ol.CoordinateArray} coordinates Array of coordinates (e.g. - * [[x0, y0], [x1, y1]]). + * `[[x0, y0], [x1, y1]]`). * @todo stability experimental */ ol.geom.LineString = function(coordinates) { diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js index b11f862858..39dd9e933c 100644 --- a/src/ol/geom/point.js +++ b/src/ol/geom/point.js @@ -12,7 +12,7 @@ goog.require('ol.geom.GeometryType'); /** * @constructor * @extends {ol.geom.Geometry} - * @param {ol.Coordinate} coordinates Coordinate values (e.g. [x, y]). + * @param {ol.Coordinate} coordinates Coordinate values (e.g. `[x, y]`). * @todo stability experimental */ ol.geom.Point = function(coordinates) { diff --git a/src/ol/object.js b/src/ol/object.js index 4d82943de0..5b122f601c 100644 --- a/src/ol/object.js +++ b/src/ol/object.js @@ -142,7 +142,7 @@ ol.Object.getAccessors = function(obj) { /** - * @param {string} key Key. + * @param {string} key Key name. * @return {string} Change name. */ ol.Object.getChangeEventType = function(key) { @@ -207,7 +207,7 @@ ol.Object.getSetterName = function(key) { * } * ); * - * @param {string} key Key. + * @param {string} key Key name. * @param {ol.Object} target Target. * @param {string=} opt_targetKey Target key. * @return {ol.ObjectAccessor} @@ -231,7 +231,7 @@ ol.Object.prototype.bindTo = function(key, target, opt_targetKey) { /** * Gets a value. - * @param {string} key Key. + * @param {string} key Key name. * @return {*} Value. * @todo stability experimental */ @@ -291,7 +291,7 @@ ol.Object.prototype.getKeys = function() { * Notify all observers of a change on this property. This notifies both * objects that are bound to the object's property as well as the object * that it is bound to. - * @param {string} key Key. + * @param {string} key Key name. * @todo stability experimental */ ol.Object.prototype.notify = function(key) { @@ -308,7 +308,7 @@ ol.Object.prototype.notify = function(key) { /** - * @param {string} key Key. + * @param {string} key Key name. * @private */ ol.Object.prototype.notifyInternal_ = function(key) { @@ -348,7 +348,7 @@ ol.Object.prototype.once = function(type, listener, opt_scope) { /** * Sets a value. - * @param {string} key Key. + * @param {string} key Key name. * @param {*} value Value. * @todo stability experimental */ @@ -394,7 +394,7 @@ ol.Object.prototype.setValues = function(values) { /** * Removes a binding. Unbinding will set the unbound property to the current * value. The object will not be notified, as the value has not changed. - * @param {string} key Key. + * @param {string} key Key name. * @todo stability experimental */ ol.Object.prototype.unbind = function(key) { diff --git a/src/ol/view2d.js b/src/ol/view2d.js index dc93ceb152..e4716f5726 100644 --- a/src/ol/view2d.js +++ b/src/ol/view2d.js @@ -192,8 +192,8 @@ ol.View2D.prototype.constrainCenter = function(center) { /** * Get the constrained the resolution of this view. * @param {number|undefined} resolution Resolution. - * @param {number=} opt_delta Delta. - * @param {number=} opt_direction Direction. + * @param {number=} opt_delta Delta. Default is `0`. + * @param {number=} opt_direction Direction. Default is `0`. * @return {number|undefined} Constrained resolution. * @todo stability experimental */ @@ -208,7 +208,7 @@ ol.View2D.prototype.constrainResolution = function( /** * Get the constrained rotation of this view. * @param {number|undefined} rotation Rotation. - * @param {number=} opt_delta Delta. + * @param {number=} opt_delta Delta. Default is `0`. * @return {number|undefined} Constrained rotation. * @todo stability experimental */