From 328910049d5ee9d1ac9bbab065cab203c567684a Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 11 Mar 2018 11:34:09 -0600 Subject: [PATCH] Move ZoomToExtentOptions to ol/control/ZoomToExtent --- externs/olx.js | 60 ---------------------------------- externs/xol.js | 13 -------- src/ol/control/ZoomToExtent.js | 17 +++++++++- 3 files changed, 16 insertions(+), 74 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 78122dae45..dfb5834b12 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,66 +5,6 @@ let olx; -/** - * @typedef {{className: (string|undefined), - * target: (Element|string|undefined), - * label: (string|Element|undefined), - * tipLabel: (string|undefined), - * extent: (ol.Extent|undefined)}} - */ -olx.control.ZoomToExtentOptions; - - -/** - * Class name. Default is `ol-zoom-extent`. - * @type {string|undefined} - * @api - */ -olx.control.ZoomToExtentOptions.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.ZoomToExtentOptions.prototype.target; - - -/** - * Text label to use for the button. Default is `E`. - * Instead of text, also an element (e.g. a `span` element) can be used. - * @type {string|Element|undefined} - * @api - */ -olx.control.ZoomToExtentOptions.prototype.label; - - -/** - * Text label to use for the button tip. Default is `Zoom to extent` - * @type {string|undefined} - * @api - */ -olx.control.ZoomToExtentOptions.prototype.tipLabel; - - -/** - * The extent to zoom to. If undefined the validity extent of the view - * projection is used. - * @type {ol.Extent|undefined} - * @api - */ -olx.control.ZoomToExtentOptions.prototype.extent; - - -/** - * Namespace. - * @type {Object} - */ -olx.format; - - /** * @typedef {{dataProjection: ol.ProjectionLike, * extent: (ol.Extent|undefined), diff --git a/externs/xol.js b/externs/xol.js index c173c6a3bc..3869f024f6 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,17 +1,4 @@ -/** - * @typedef {Object} control_ZoomToExtentOptions - * @property {string|undefined} className Class name. Default is `ol-zoom-extent`. - * @property {Element|string|undefined} 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 extent of the view - * projection is used. - */ - - /** * @typedef {Object} format_ReadOptions * @property {ol.ProjectionLike} dataProjection Projection of the data we are reading. If not provided, the projection will diff --git a/src/ol/control/ZoomToExtent.js b/src/ol/control/ZoomToExtent.js index 022021c202..b32f05b50a 100644 --- a/src/ol/control/ZoomToExtent.js +++ b/src/ol/control/ZoomToExtent.js @@ -7,6 +7,21 @@ import EventType from '../events/EventType.js'; import Control from '../control/Control.js'; 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 + * 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 + * extent of the view projection is used. + */ + + /** * @classdesc * A button control which, when pressed, changes the map view to a specific @@ -14,7 +29,7 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js'; * * @constructor * @extends {ol.control.Control} - * @param {olx.control.ZoomToExtentOptions=} opt_options Options. + * @param {module:ol/control/ZoomToExtent~Options=} opt_options Options. * @api */ const ZoomToExtent = function(opt_options) {