From 403a7bdfc74587979e7d1500ca7ce16d48de464a Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 13 Mar 2018 13:26:34 +0100 Subject: [PATCH] Mark optional property with square brackets --- src/ol/control/Attribution.js | 25 +++++++++++-------------- src/ol/control/MousePosition.js | 13 +++++-------- src/ol/control/OverviewMap.js | 28 ++++++++++++---------------- src/ol/control/Rotate.js | 2 +- src/ol/control/ScaleLine.js | 10 +++++----- src/ol/control/ZoomSlider.js | 2 +- src/ol/control/ZoomToExtent.js | 13 ++++++------- 7 files changed, 41 insertions(+), 52 deletions(-) diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index 27aed85ccd..b72d1a8dce 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -13,26 +13,23 @@ import {visibleAtResolution} from '../layer/Layer.js'; /** * @typedef {Object} Options - * @property {string|undefined} className CSS class name. Default is - * `'ol-attribution'`. - * @property {Element|string|undefined} target Specify a target if you + * @property {string} [className='ol-attribution'] CSS class name. + * @property {Element|string} [target] Specify a target if you * want the control to be rendered outside of the map's * viewport. - * @property {boolean|undefined} collapsible Specify if attributions can + * @property {boolean} [collapsible=true] Specify if attributions can * be collapsed. If you use an OSM source, should be set to `false` — see * {@link https://www.openstreetmap.org/copyright OSM Copyright} — - * Default is `true`. - * @property {boolean|undefined} collapsed Specify if attributions should - * be collapsed at startup. Default is `true`. - * @property {string|undefined} tipLabel Text label to use for the button - * tip. Default is `'Attributions'` - * @property {string|Element|undefined} label Text label to use for the - * collapsed attributions button. Default is `'i'`. + * @property {boolean} [collapsed=true] Specify if attributions should + * be collapsed at startup. + * @property {string} [tipLabel='Attributions'] Text label to use for the button tip. + * @property {string} [label='i'] Text label to use for the + * collapsed attributions button. * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string|Element|undefined} collapseLabel Text label to use - * for the expanded attributions button. Default is `'»'`. + * @property {string|Element} [collapseLabel='»'] Text label to use + * for the expanded attributions button. * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {function(ol.MapEvent)|undefined} render Function called when + * @property {function(ol.MapEvent)} [render] Function called when * the control should be re-rendered. This is called in a `requestAnimationFrame` * callback. */ diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index 43a4c30cb1..22f2b884c3 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -23,18 +23,15 @@ const COORDINATE_FORMAT = 'coordinateFormat'; /** * @typedef {Object} Options - * @property {string|undefined} className CSS class name. Default is - * `'ol-mouse-position'`. - * @property {module:ol/coordinate~CoordinateFormat|undefined} coordinateFormat - * Coordinate format. + * @property {string} [className='ol-mouse-position'] CSS class name. + * @property {module:ol/coordinate~CoordinateFormat} [coordinateFormat] Coordinate format. * @property {ol.ProjectionLike} projection Projection. - * @property {function(ol.MapEvent)|undefined} render Function called when the + * @property {function(ol.MapEvent)} [render] Function called when the * control should be re-rendered. This is called in a `requestAnimationFrame` * callback. - * @property {Element|string|undefined} target Specify a target if you want the + * @property {Element|string} [target] Specify a target if you want the * control to be rendered outside of the map's viewport. - * @property {string|undefined} undefinedHTML Markup for undefined coordinates. - * Default is `''` (empty string). + * @property {string} [undefinedHTML=''] Markup for undefined coordinates. */ diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index 382a394a6b..f2914d8eb5 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -38,26 +38,22 @@ const MIN_RATIO = 0.1; /** * @typedef {Object} Options - * @property {boolean|undefined} collapsed Whether the control should start collapsed - * or not (expanded). Default to `true`. - * @property {string|Element|undefined} collapseLabel Text label to use for the - * expanded overviewmap button. Default is `'«'`. Instead of text, also an element - * (e.g. a `span` element) can be used. - * @property {boolean|undefined} collapsible Whether the control can be collapsed - * or not. Default to `true`. - * @property {string|Element|undefined} label Text label to use for the collapsed - * overviewmap button. Default is `'»'`. Instead of text, also an element - * (e.g. a `span` element) can be used. - * @property {Array.|ol.Collection.|undefined} layers + * @property {boolean} [collapsed=true] Whether the control should start collapsed + * or not (expanded). + * @property {string|Element} [collapseLabel='«'] Text label to use for the + * expanded overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used. + * @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] * Layers for the overview map. If not set, then all main map layers are used * instead. - * @property {function(ol.MapEvent)|undefined} render Function called when the control + * @property {function(ol.MapEvent)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. - * @property {Element|string|undefined} target Specify a target if you want the control + * @property {Element|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. - * @property {string|undefined} tipLabel Text label to use for the button tip. Default - * is `'Overview map'`. - * @property {ol.View|undefined} view Custom view for the overview map. If not provided, + * @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, * a default view with an EPSG:3857 projection will be used. */ diff --git a/src/ol/control/Rotate.js b/src/ol/control/Rotate.js index 0ff894b973..6c3d7f1cd3 100644 --- a/src/ol/control/Rotate.js +++ b/src/ol/control/Rotate.js @@ -18,7 +18,7 @@ import {inherits} from '../index.js'; * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip. * @property {number} [duration=250] Animation duration in milliseconds. * @property {boolean} [autoHide=true] Hide the control when rotation is 0. - * @property {function(ol.MapEvent)|undefined} render Function called when the control should + * @property {function(ol.MapEvent)} [render] Function called when the control should * be re-rendered. This is called in a `requestAnimationFrame` callback. * @property {function()} [resetNorth] Function called when the control is clicked. * This will override the default `resetNorth`. diff --git a/src/ol/control/ScaleLine.js b/src/ol/control/ScaleLine.js index 3de1e823f5..d3b6b2fb42 100644 --- a/src/ol/control/ScaleLine.js +++ b/src/ol/control/ScaleLine.js @@ -27,13 +27,13 @@ const LEADING_DIGITS = [1, 2, 5]; /** * @typedef {Object} Options - * @property {string|undefined} className CSS Class name. Default is `'ol-scale-line'`. - * @property {number|undefined} minWidth Minimum width in pixels. Default is `64`. - * @property {function(ol.MapEvent)|undefined} render Function called when the control + * @property {string} [className='ol-scale-line'] CSS Class name. + * @property {number} [minWidth=64] Minimum width in pixels. + * @property {function(ol.MapEvent)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. - * @property {Element|string|undefined} target Specify a target if you want the control + * @property {Element|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. - * @property {ol.control.ScaleLineUnits|string|undefined} units Units. Default is `'metric'`. + * @property {ol.control.ScaleLineUnits|string} [units='metric'] Units. */ diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index 23a1cdbace..8717cc22d8 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -31,7 +31,7 @@ const Direction = { * @property {number} [duration=200] Animation duration in milliseconds. * @property {number|undefined} maxResolution Maximum resolution. * @property {number|undefined} minResolution Minimum resolution. - * @property {function(ol.MapEvent)|undefined} render Function called when the control + * @property {function(ol.MapEvent)} [render] Function called when the control * should be re-rendered. This is called in a `requestAnimationFrame` callback. */ diff --git a/src/ol/control/ZoomToExtent.js b/src/ol/control/ZoomToExtent.js index b32f05b50a..30563f7fa7 100644 --- a/src/ol/control/ZoomToExtent.js +++ b/src/ol/control/ZoomToExtent.js @@ -10,14 +10,13 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js'; /** * @typedef {Object} Options - * @property {string|undefined} className Class name. Default is `'ol-zoom-extent'`. - * @property {Element|string|undefined} target Specify a target if you want the control + * @property {string} [className='ol-zoom-extent'] Class name. + * @property {Element|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. - * @property {string|Element|undefined} label Text label to use for the button. Default - * is `'E'`. Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string|undefined} tipLabel Text label to use for the button tip. Default - * is `'Zoom to extent'`. - * @property {ol.Extent|undefined} extent The extent to zoom to. If undefined the validity + * @property {string|Element} [label='E'] Text label to use for the button. + * Instead of text, also an element (e.g. a `span` element) can be used. + * @property {string} [tipLabel='Zoom to extent'] Text label to use for the button tip. + * @property {ol.Extent} [extent] The extent to zoom to. If undefined the validity * extent of the view projection is used. */