Move RotateOptions to ol/control/Rotate
This commit is contained in:
@@ -5,87 +5,6 @@
|
||||
let olx;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{duration: (number|undefined),
|
||||
* className: (string|undefined),
|
||||
* label: (string|Element|undefined),
|
||||
* tipLabel: (string|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* render: (function(ol.MapEvent)|undefined),
|
||||
* resetNorth: (function()|undefined),
|
||||
* autoHide: (boolean|undefined)}}
|
||||
*/
|
||||
olx.control.RotateOptions;
|
||||
|
||||
|
||||
/**
|
||||
* CSS class name. Default is `ol-rotate`.
|
||||
* @type {string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.className;
|
||||
|
||||
|
||||
/**
|
||||
* Text label to use for the rotate button. Default is `⇧`.
|
||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
||||
* @type {string|Element|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.label;
|
||||
|
||||
|
||||
/**
|
||||
* Text label to use for the rotate tip. Default is `Reset rotation`
|
||||
* @type {string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.tipLabel;
|
||||
|
||||
|
||||
/**
|
||||
* Animation duration in milliseconds. Default is `250`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.duration;
|
||||
|
||||
|
||||
/**
|
||||
* Hide the control when rotation is 0. Default is `true`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.autoHide;
|
||||
|
||||
|
||||
/**
|
||||
* Function called when the control should be re-rendered. This is called
|
||||
* in a requestAnimationFrame callback.
|
||||
* @type {function(ol.MapEvent)|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.render;
|
||||
|
||||
|
||||
/**
|
||||
* Function called when the control is clicked. This will override the
|
||||
* default resetNorth.
|
||||
* @type {function()|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.resetNorth;
|
||||
|
||||
|
||||
/**
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.target;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{duration: (number|undefined),
|
||||
* className: (string|undefined),
|
||||
|
||||
@@ -1,21 +1,4 @@
|
||||
|
||||
/**
|
||||
* @typedef {Object} control_RotateOptions
|
||||
* @property {string|undefined} className CSS class name. Default is `ol-rotate`.
|
||||
* @property {string|Element|undefined} label Text label to use for the rotate button. Default is `⇧`.
|
||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
||||
* @property {string|undefined} tipLabel Text label to use for the rotate tip. Default is `Reset rotation`
|
||||
* @property {number|undefined} duration Animation duration in milliseconds. Default is `250`.
|
||||
* @property {boolean|undefined} autoHide Hide the control when rotation is 0. Default is `true`.
|
||||
* @property {function(ol.MapEvent)|undefined} render Function called when the control should be re-rendered. This is called
|
||||
* in a requestAnimationFrame callback.
|
||||
* @property {function()|undefined} resetNorth Function called when the control is clicked. This will override the
|
||||
* default resetNorth.
|
||||
* @property {Element|string|undefined} target Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} control_ZoomOptions
|
||||
* @property {number|undefined} duration Animation duration in milliseconds. Default is `250`.
|
||||
|
||||
@@ -9,6 +9,25 @@ import {listen} from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {inherits} from '../index.js';
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {string|undefined} className CSS class name. Default is `'ol-rotate'`.
|
||||
* @property {string|Element|undefined} label Text label to use for the rotate button.
|
||||
* Default is `'⇧'`. Instead of text, also an element (e.g. a `span` element) can be used.
|
||||
* @property {string|undefined} tipLabel Text label to use for the rotate tip. Default is
|
||||
* `'Reset rotation'`
|
||||
* @property {number|undefined} duration Animation duration in milliseconds. Default is `250`.
|
||||
* @property {boolean|undefined} autoHide Hide the control when rotation is 0. Default is `true`.
|
||||
* @property {function(ol.MapEvent)|undefined} render Function called when the control should
|
||||
* be re-rendered. This is called in a `requestAnimationFrame` callback.
|
||||
* @property {function()|undefined} resetNorth Function called when the control is clicked.
|
||||
* This will override the default `resetNorth`.
|
||||
* @property {Element|string|undefined} target Specify a target if you want the control to be
|
||||
* rendered outside of the map's viewport.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A button control to reset rotation to 0.
|
||||
@@ -17,7 +36,7 @@ import {inherits} from '../index.js';
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.control.Control}
|
||||
* @param {olx.control.RotateOptions=} opt_options Rotate options.
|
||||
* @param {module:ol/control/Rotate~Options=} opt_options Rotate options.
|
||||
* @api
|
||||
*/
|
||||
const Rotate = function(opt_options) {
|
||||
|
||||
Reference in New Issue
Block a user