Document custom controls
This commit is contained in:
@@ -10,13 +10,26 @@ goog.require('ol.Object');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Abstract base class; normally only used for creating subclasses and not
|
|
||||||
* instantiated in apps.
|
|
||||||
* A control is a visible widget with a DOM element in a fixed position on the
|
* A control is a visible widget with a DOM element in a fixed position on the
|
||||||
* screen. They can involve user input (buttons), or be informational only;
|
* screen. They can involve user input (buttons), or be informational only;
|
||||||
* the position is determined using CSS. By default these are part of the map
|
* the position is determined using CSS. By default these are part of the map
|
||||||
* container, but can use any outside DOM element.
|
* container, but can use any outside DOM element.
|
||||||
*
|
*
|
||||||
|
* 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 ol.control.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 `ol.Object`s 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.
|
||||||
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.Object}
|
* @extends {ol.Object}
|
||||||
* @implements {oli.control.Control}
|
* @implements {oli.control.Control}
|
||||||
|
|||||||
Reference in New Issue
Block a user