From 5dcfa1137d5ea177422e2162c8cda56c406bd7c9 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 11 Mar 2018 10:46:56 -0600 Subject: [PATCH] Move FullScreenOptions to ol/control/FullScreen --- externs/olx.js | 70 ------------------------------------ externs/xol.js | 16 --------- src/ol/control/FullScreen.js | 23 +++++++++++- 3 files changed, 22 insertions(+), 87 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 47c67ff5f6..215b3d5227 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -12,76 +12,6 @@ let olx; olx.control; -/** - * @typedef {{className: (string|undefined), - * label: (string|Element|undefined), - * labelActive: (string|Element|undefined), - * tipLabel: (string|undefined), - * keys: (boolean|undefined), - * target: (Element|string|undefined), - * source: (Element|string|undefined)}} - */ -olx.control.FullScreenOptions; - - -/** - * CSS class name. Default is `ol-full-screen`. - * @type {string|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.className; - - -/** - * Text label to use for the button. Default is `\u2922` (NORTH EAST AND SOUTH WEST ARROW). - * Instead of text, also an element (e.g. a `span` element) can be used. - * @type {string|Element|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.label; - - -/** - * Text label to use for the button when full-screen is active. - * Default is `\u00d7` (a cross). - * Instead of text, also an element (e.g. a `span` element) can be used. - * @type {string|Element|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.labelActive; - - -/** - * Text label to use for the button tip. Default is `Toggle full-screen` - * @type {string|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.tipLabel; - - -/** - * Full keyboard access. - * @type {boolean|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.keys; - - -/** - * Specify a target if you want the control to be rendered outside of the map's - * viewport. - * @type {Element|string|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.target; - -/** - * The element to be displayed fullscreen. When not provided, the element containing the map viewport will be displayed fullscreen. - * @type {Element|string|undefined} - * @api - */ -olx.control.FullScreenOptions.prototype.source; - /** * @typedef {{className: (string|undefined), * coordinateFormat: (module:ol/coordinate~CoordinateFormat|undefined), diff --git a/externs/xol.js b/externs/xol.js index e538c11496..4dcb5a9ae3 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,20 +1,4 @@ -/** - * @typedef {Object} control_FullScreenOptions - * @property {string|undefined} className CSS class name. Default is `ol-full-screen`. - * @property {string|Element|undefined} label Text label to use for the button. Default is `\u2922` (NORTH EAST AND SOUTH WEST ARROW). - * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string|Element|undefined} labelActive Text label to use for the button when full-screen is active. - * Default is `\u00d7` (a cross). - * 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 `Toggle full-screen` - * @property {boolean|undefined} keys Full keyboard access. - * @property {Element|string|undefined} target Specify a target if you want the control to be rendered outside of the map's - * viewport. - * @property {Element|string|undefined} source The element to be displayed fullscreen. When not provided, the element containing the map viewport will be displayed fullscreen. - */ - - /** * @typedef {Object} control_MousePositionOptions * @property {string|undefined} className CSS class name. Default is `ol-mouse-position`. diff --git a/src/ol/control/FullScreen.js b/src/ol/control/FullScreen.js index e05459233e..b138abc152 100644 --- a/src/ol/control/FullScreen.js +++ b/src/ol/control/FullScreen.js @@ -32,6 +32,27 @@ const getChangeType = (function() { })(); +/** + * @typedef {Object} Options + * @property {string|undefined} className CSS class name. Default is + * `'ol-full-screen'`. + * @property {string|Element|undefined} label Text label to use for the button. + * Default is `'\u2922'` (NORTH EAST AND SOUTH WEST ARROW). + * Instead of text, also an element (e.g. a `span` element) can be used. + * @property {string|Element|undefined} labelActive Text label to use for the + * button when full-screen is active. Default is `'\u00d7'` (a cross). + * 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 `'Toggle full-screen'`. + * @property {boolean|undefined} keys Full keyboard access. + * @property {Element|string|undefined} target Specify a target if you want the + * control to be rendered outside of the map's viewport. + * @property {Element|string|undefined} source The element to be displayed + * fullscreen. When not provided, the element containing the map viewport will + * be displayed fullscreen. + */ + + /** * @classdesc * Provides a button that when clicked fills up the full screen with the map. @@ -46,7 +67,7 @@ const getChangeType = (function() { * * @constructor * @extends {ol.control.Control} - * @param {olx.control.FullScreenOptions=} opt_options Options. + * @param {module:ol/control/FullScreen~Options=} opt_options Options. * @api */ const FullScreen = function(opt_options) {