diff --git a/externs/olx.js b/externs/olx.js index dde9aa5af8..631df3239d 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -12,90 +12,6 @@ let olx; olx.control; -/** - * @typedef {{className: (string|undefined), - * collapsible: (boolean|undefined), - * collapsed: (boolean|undefined), - * tipLabel: (string|undefined), - * label: (string|Element|undefined), - * collapseLabel: (string|Element|undefined), - * render: (function(ol.MapEvent)|undefined), - * target: (Element|string|undefined)}} - */ -olx.control.AttributionOptions; - - -/** - * CSS class name. Default is `ol-attribution`. - * @type {string|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.className; - - -/** - * Specify a target if you want the control to be rendered outside of the map's - * viewport. - * @type {Element|string|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.target; - - -/** - * 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`. - * @type {boolean|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.collapsible; - - -/** - * Specify if attributions should be collapsed at startup. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.collapsed; - - -/** - * Text label to use for the button tip. Default is `Attributions` - * @type {string|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.tipLabel; - - -/** - * Text label to use for the collapsed attributions button. Default is `i`. - * Instead of text, also an element (e.g. a `span` element) can be used. - * @type {string|Element|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.label; - - -/** - * Text label to use for the expanded attributions button. Default is `»`. - * Instead of text, also an element (e.g. a `span` element) can be used. - * @type {string|Element|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.collapseLabel; - - -/** - * Function called when the control should be re-rendered. This is called - * in a requestAnimationFrame callback. - * @type {function(ol.MapEvent)|undefined} - * @api - */ -olx.control.AttributionOptions.prototype.render; - - /** * @typedef {{element: (Element|undefined), * render: (function(ol.MapEvent)|undefined), diff --git a/externs/xol.js b/externs/xol.js index 4a26edba5d..0a3b26c149 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,24 +1,4 @@ -/** - * @typedef {Object} control_AttributionOptions - * @property {string|undefined} className CSS class name. Default is `ol-attribution`. - * @property {Element|string|undefined} 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 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`. - * 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 `»`. - * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {function(ol.MapEvent)|undefined} render Function called when the control should be re-rendered. This is called - * in a requestAnimationFrame callback. - */ - - /** * @typedef {Object} control_ControlOptions * @property {Element|undefined} element The element is the control's container element. This only needs to be diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index 6224c417fe..27aed85ccd 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -10,6 +10,34 @@ import {listen} from '../events.js'; import EventType from '../events/EventType.js'; 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 + * want the control to be rendered outside of the map's + * viewport. + * @property {boolean|undefined} collapsible 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'`. + * 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 `'»'`. + * Instead of text, also an element (e.g. a `span` element) can be used. + * @property {function(ol.MapEvent)|undefined} render Function called when + * the control should be re-rendered. This is called in a `requestAnimationFrame` + * callback. + */ + + /** * @classdesc * Control to show all the attributions associated with the layer sources @@ -19,7 +47,7 @@ import {visibleAtResolution} from '../layer/Layer.js'; * * @constructor * @extends {ol.control.Control} - * @param {olx.control.AttributionOptions=} opt_options Attribution options. + * @param {module:ol/control/Attribution~Options=} opt_options Attribution options. * @api */ const Attribution = function(opt_options) {