Move jsdoc constructor comments for controls

This commit is contained in:
Frederic Junod
2018-07-17 16:44:33 +02:00
parent e1e5e54d74
commit f140ff368d
10 changed files with 41 additions and 22 deletions

View File

@@ -41,11 +41,13 @@ import {visibleAtResolution} from '../layer/Layer.js';
* By default it will show in the bottom right portion of the map, but this can * By default it will show in the bottom right portion of the map, but this can
* be changed by using a css selector for `.ol-attribution`. * be changed by using a css selector for `.ol-attribution`.
* *
* @constructor
* @param {module:ol/control/Attribution~Options=} opt_options Attribution options.
* @api * @api
*/ */
class Attribution extends Control { class Attribution extends Control {
/**
* @param {module:ol/control/Attribution~Options=} opt_options Attribution options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -43,11 +43,13 @@ import {listen, unlistenByKey} from '../events.js';
* You can also extend this base for your own control class. See * You can also extend this base for your own control class. See
* examples/custom-controls for an example of how to do this. * examples/custom-controls for an example of how to do this.
* *
* @constructor
* @param {module:ol/control/Control~Options} options Control options.
* @api * @api
*/ */
class Control extends BaseObject { class Control extends BaseObject {
/**
* @param {module:ol/control/Control~Options} options Control options.
*/
constructor(options) { constructor(options) {
super(); super();

View File

@@ -60,12 +60,13 @@ const getChangeType = (function() {
* The [Fullscreen API](http://www.w3.org/TR/fullscreen/) is used to * The [Fullscreen API](http://www.w3.org/TR/fullscreen/) is used to
* toggle the map in full screen mode. * toggle the map in full screen mode.
* *
*
* @constructor
* @param {module:ol/control/FullScreen~Options=} opt_options Options.
* @api * @api
*/ */
class FullScreen extends Control { class FullScreen extends Control {
/**
* @param {module:ol/control/FullScreen~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -44,12 +44,13 @@ const COORDINATE_FORMAT = 'coordinateFormat';
* By default the control is shown in the top right corner of the map, but this * By default the control is shown in the top right corner of the map, but this
* can be changed by using the css selector `.ol-mouse-position`. * can be changed by using the css selector `.ol-mouse-position`.
* *
* @constructor
* @param {module:ol/control/MousePosition~Options=} opt_options Mouse position
* options.
* @api * @api
*/ */
class MousePosition extends Control { class MousePosition extends Control {
/**
* @param {module:ol/control/MousePosition~Options=} opt_options Mouse position options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -60,11 +60,14 @@ const MIN_RATIO = 0.1;
/** /**
* Create a new control with a map acting as an overview map for an other * Create a new control with a map acting as an overview map for an other
* defined map. * defined map.
* @constructor *
* @param {module:ol/control/OverviewMap~Options=} opt_options OverviewMap options.
* @api * @api
*/ */
class OverviewMap extends Control { class OverviewMap extends Control {
/**
* @param {module:ol/control/OverviewMap~Options=} opt_options OverviewMap options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -31,11 +31,13 @@ import EventType from '../events/EventType.js';
* To style this control use css selector `.ol-rotate`. A `.ol-hidden` css * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css
* selector is added to the button when the rotation is 0. * selector is added to the button when the rotation is 0.
* *
* @constructor
* @param {module:ol/control/Rotate~Options=} opt_options Rotate options.
* @api * @api
*/ */
class Rotate extends Control { class Rotate extends Control {
/**
* @param {module:ol/control/Rotate~Options=} opt_options Rotate options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -58,11 +58,13 @@ const LEADING_DIGITS = [1, 2, 5];
* By default the scale line will show in the bottom left portion of the map, * By default the scale line will show in the bottom left portion of the map,
* but this can be changed by using the css selector `.ol-scale-line`. * but this can be changed by using the css selector `.ol-scale-line`.
* *
* @constructor
* @param {module:ol/control/ScaleLine~Options=} opt_options Scale line options.
* @api * @api
*/ */
class ScaleLine extends Control { class ScaleLine extends Control {
/**
* @param {module:ol/control/ScaleLine~Options=} opt_options Scale line options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -30,11 +30,13 @@ import {easeOut} from '../easing.js';
* This control is one of the default controls of a map. To style this control * This control is one of the default controls of a map. To style this control
* use css selectors `.ol-zoom-in` and `.ol-zoom-out`. * use css selectors `.ol-zoom-in` and `.ol-zoom-out`.
* *
* @constructor
* @param {module:ol/control/Zoom~Options=} opt_options Zoom options.
* @api * @api
*/ */
class Zoom extends Control { class Zoom extends Control {
/**
* @param {module:ol/control/Zoom~Options=} opt_options Zoom options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -41,11 +41,13 @@ const Direction = {
* *
* map.addControl(new ZoomSlider()); * map.addControl(new ZoomSlider());
* *
* @constructor
* @param {module:ol/control/ZoomSlider~Options=} opt_options Zoom slider options.
* @api * @api
*/ */
class ZoomSlider extends Control { class ZoomSlider extends Control {
/**
* @param {module:ol/control/ZoomSlider~Options=} opt_options Zoom slider options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -25,11 +25,13 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
* A button control which, when pressed, changes the map view to a specific * A button control which, when pressed, changes the map view to a specific
* extent. To style this control use the css selector `.ol-zoom-extent`. * extent. To style this control use the css selector `.ol-zoom-extent`.
* *
* @constructor
* @param {module:ol/control/ZoomToExtent~Options=} opt_options Options.
* @api * @api
*/ */
class ZoomToExtent extends Control { class ZoomToExtent extends Control {
/**
* @param {module:ol/control/ZoomToExtent~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};