Move ZoomToExtentOptions to ol/control/ZoomToExtent

This commit is contained in:
Tim Schaub
2018-03-11 11:34:09 -06:00
parent 4c7a07e4b8
commit 328910049d
3 changed files with 16 additions and 74 deletions

View File

@@ -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),

View File

@@ -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

View File

@@ -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) {