Remove olx.js and code that uses it

This commit is contained in:
Tim Schaub
2018-04-19 18:06:09 -06:00
parent 20bbd71702
commit d93a76dcb9
10 changed files with 11 additions and 126 deletions

View File

@@ -2,9 +2,9 @@
This directory contains externs files, which tell the Closure compiler about symbols and properties that it should not rename.
## oli.js and olx.js
## oli.js
These two files are special externs that belong to OpenLayers, and this document explains their purpose and how they are used.
These are special externs that belong to OpenLayers, and this document explains their purpose and how they are used.
### Prevent class properties from being renamed
@@ -82,39 +82,3 @@ ol.control.Control.prototype.setMap = function(map) {
};
```
See Custom controls example for an example of how this can be used.
### Export object literals
Object literals cannot be exported like classes. To make sure that their properties do not get renamed, they go in `olx.js`:
```js
/**
* @typedef {{element: (Element|undefined),
* target: (Element|string|undefined)}}
* @api
*/
olx.control.ControlOptions;
/**
* The element is the control's container element. This only needs to be
* specified if you're developing a custom control.
* @type {Element|undefined}
*/
olx.control.ControlOptions.prototype.element;
/**
* Specify a target if you want the control to be rendered outside of the map's
* viewport.
* @type {Element|string|undefined}
*/
olx.control.ControlOptions.prototype.target;
```
In the source code, the name used for the typedef is used as type whenever this object literal is expected:
```js
/**
* ...
* @param {olx.control.ControlOptions} options Control options.
*/
ol.control.Control = function(options) {
// ...
};
```