Improvements to externs readme
This commit is contained in:
+3
-2
@@ -8,7 +8,7 @@ These two files are special externs that belong to ol3, and this document explai
|
|||||||
|
|
||||||
### Prevent class properties from being renamed
|
### Prevent class properties from being renamed
|
||||||
|
|
||||||
For events, we make properties available to the application. Other than methods, which can be made available by just marking them with the `@api` annotation directly where they are defined, properties need to be added to `oli.js` in addition:
|
For events, we make properties available to the application. Methods can be made available by just marking them with the `@api` annotation directly where they are defined; properties should also be added to `oli.js`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
/** @interface */
|
/** @interface */
|
||||||
@@ -43,7 +43,7 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_frameState) {
|
|||||||
|
|
||||||
### Override methods in custom classes
|
### Override methods in custom classes
|
||||||
|
|
||||||
For custom subclasses in applications, which can be created using `ol.extends`, the API may want to make certain methods available to override. In addition to marking such methods as `@api`, they need also be added to an interface in `oli.js`:
|
For custom subclasses in applications, which can be created using `ol.inherits`, the API may want to make certain methods available to override. In addition to marking such methods as `@api`, they should also be added to an interface in `oli.js`:
|
||||||
```js
|
```js
|
||||||
/**
|
/**
|
||||||
* @interface
|
* @interface
|
||||||
@@ -79,6 +79,7 @@ ol.control.Control.prototype.setMap = function(map) {
|
|||||||
// ...
|
// ...
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
See Custom controls example for an example of how this can be used.
|
||||||
|
|
||||||
### Export object literals
|
### Export object literals
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user