-
Notifications
You must be signed in to change notification settings - Fork 458
/
ext.js
59 lines (52 loc) · 1.49 KB
/
ext.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import ol_Map from 'ol/Map'
/*global ol*/
if (window.ol) {
/** @namespace ol.ext */
if (!ol.ext) ol.ext = {};
/** @namespace ol.legend */
if (!ol.legend) ol.legend = {};
/** @namespace ol.particule */
if (!ol.particule) ol.particule = {};
/** @namespace ol.ext.imageLoader */
if (!ol.ext.imageLoader) ol.ext.imageLoader = {};
/** @namespace ol.ext.input */
if (!ol.ext.input) ol.ext.input = {};
/* Version */
if (!ol.util) {
ol.util = {
VERSION: ol.VERSION || '5.3.0'
};
} else if (!ol.util.VERSION) {
ol.util.VERSION = ol.VERSION || '6.1.0'
}
}
/** Inherit the prototype methods from one constructor into another.
* replace deprecated ol method
*
* @param {!Function} childCtor Child constructor.
* @param {!Function} parentCtor Parent constructor.
* @function module:ol.inherits
* @api
*/
var ol_ext_inherits = function(child,parent) {
child.prototype = Object.create(parent.prototype);
child.prototype.constructor = child;
};
// Compatibilty with ol > 5 to be removed when v6 is out
if (window.ol) {
if (!ol.inherits) ol.inherits = ol_ext_inherits;
}
/* IE Polyfill */
// NodeList.forEach
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
}
// Element.remove
if (window.Element && !Element.prototype.remove) {
Element.prototype.remove = function() {
if (this.parentNode) this.parentNode.removeChild(this);
}
}
/* End Polyfill */
export { ol_ext_inherits }
export default ol_ext_inherits