From a3ead88c57b3c0f6620f720bcb18f9a53d467685 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 18 Mar 2018 10:23:01 -0600 Subject: [PATCH] Module types for controls --- examples/custom-controls.js | 2 +- src/ol/control/Attribution.js | 2 +- src/ol/control/Control.js | 5 ++--- src/ol/control/MousePosition.js | 2 +- src/ol/control/OverviewMap.js | 2 +- src/ol/control/Rotate.js | 2 +- src/ol/control/ScaleLine.js | 14 +++++++------- src/ol/control/ZoomSlider.js | 4 ++-- 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/examples/custom-controls.js b/examples/custom-controls.js index 7d94e1b046..2516619362 100644 --- a/examples/custom-controls.js +++ b/examples/custom-controls.js @@ -21,7 +21,7 @@ const app = window.app; /** * @constructor - * @extends {ol.control.Control} + * @extends {module:ol/control/Control~Control} * @param {Object=} opt_options Control options. */ app.RotateNorthControl = function(opt_options) { diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index e6626dc467..cf2932a81f 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -209,7 +209,7 @@ Attribution.prototype.getSourceAttributions_ = function(frameState) { /** * Update the attribution element. * @param {module:ol/MapEvent~MapEvent} mapEvent Map event. - * @this {ol.control.Attribution} + * @this {module:ol/control/Attribution~Attribution} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index b762345f78..7832bfd562 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -33,14 +33,13 @@ import {listen, unlistenByKey} from '../events.js'; * This is the base class for controls. You can use it for simple custom * controls by creating the element with listeners, creating an instance: * ```js - * var myControl = new module:ol/control/Control~Control({element: myElement}); + * var myControl = new Control({element: myElement}); * ``` * and then adding this to the map. * * The main advantage of having this as a control rather than a simple separate * DOM element is that preventing propagation is handled for you. Controls - * will also be `module:ol/Object~BaseObject`s in a `ol.Collection`, so you can use their - * methods. + * will also be objects in a `ol.Collection`, so you can use their methods. * * You can also extend this base for your own control class. See * examples/custom-controls for an example of how to do this. diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index 28f576c543..20c9c48b84 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -110,7 +110,7 @@ inherits(MousePosition, Control); /** * Update the mouseposition element. * @param {module:ol/MapEvent~MapEvent} mapEvent Map event. - * @this {ol.control.MousePosition} + * @this {module:ol/control/MousePosition~MousePosition} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index a2ad83d392..9f99531d00 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -323,7 +323,7 @@ OverviewMap.prototype.handleRotationChanged_ = function() { /** * Update the overview map element. * @param {module:ol/MapEvent~MapEvent} mapEvent Map event. - * @this {ol.control.OverviewMap} + * @this {module:ol/control/OverviewMap~OverviewMap} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/Rotate.js b/src/ol/control/Rotate.js index 3c05ed8b82..f4cd00cf89 100644 --- a/src/ol/control/Rotate.js +++ b/src/ol/control/Rotate.js @@ -154,7 +154,7 @@ Rotate.prototype.resetNorth_ = function() { /** * Update the rotate control element. * @param {module:ol/MapEvent~MapEvent} mapEvent Map event. - * @this {ol.control.Rotate} + * @this {module:ol/control/Rotate~Rotate} * @api */ export function render(mapEvent) { diff --git a/src/ol/control/ScaleLine.js b/src/ol/control/ScaleLine.js index bf3813fc04..f4993f30a3 100644 --- a/src/ol/control/ScaleLine.js +++ b/src/ol/control/ScaleLine.js @@ -33,7 +33,7 @@ const LEADING_DIGITS = [1, 2, 5]; * should be re-rendered. This is called in a `requestAnimationFrame` callback. * @property {Element|string} [target] Specify a target if you want the control * to be rendered outside of the map's viewport. - * @property {ol.control.ScaleLineUnits|string} [units='metric'] Units. + * @property {module:ol/control/ScaleLineUnits~ScaleLineUnits|string} [units='metric'] Units. */ @@ -113,7 +113,7 @@ const ScaleLine = function(opt_options) { this, getChangeEventType(UNITS), this.handleUnitsChanged_, this); - this.setUnits(/** @type {ol.control.ScaleLineUnits} */ (options.units) || + this.setUnits(/** @type {module:ol/control/ScaleLineUnits~ScaleLineUnits} */ (options.units) || ScaleLineUnits.METRIC); }; @@ -123,20 +123,20 @@ inherits(ScaleLine, Control); /** * Return the units to use in the scale line. - * @return {ol.control.ScaleLineUnits|undefined} The units to use in the scale - * line. + * @return {module:ol/control/ScaleLineUnits~ScaleLineUnits|undefined} The units + * to use in the scale line. * @observable * @api */ ScaleLine.prototype.getUnits = function() { - return /** @type {ol.control.ScaleLineUnits|undefined} */ (this.get(UNITS)); + return /** @type {module:ol/control/ScaleLineUnits~ScaleLineUnits|undefined} */ (this.get(UNITS)); }; /** * Update the scale line element. * @param {module:ol/MapEvent~MapEvent} mapEvent Map event. - * @this {ol.control.ScaleLine} + * @this {module:ol/control/ScaleLine~ScaleLine} * @api */ export function render(mapEvent) { @@ -160,7 +160,7 @@ ScaleLine.prototype.handleUnitsChanged_ = function() { /** * Set the units to use in the scale line. - * @param {ol.control.ScaleLineUnits} units The units to use in the scale line. + * @param {module:ol/control/ScaleLineUnits~ScaleLineUnits} units The units to use in the scale line. * @observable * @api */ diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index d7cb9da3af..a2e2fdef25 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -42,7 +42,7 @@ const Direction = { * * Example: * - * map.addControl(new ol.control.ZoomSlider()); + * map.addControl(new ZoomSlider()); * * @constructor * @extends {module:ol/control/Control~Control} @@ -210,7 +210,7 @@ ZoomSlider.prototype.initSlider_ = function() { /** * Update the zoomslider element. * @param {module:ol/MapEvent~MapEvent} mapEvent Map event. - * @this {ol.control.ZoomSlider} + * @this {module:ol/control/ZoomSlider~ZoomSlider} * @api */ export function render(mapEvent) {