Module types for controls
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user