Skip to content

Commit ed688ca

Browse files
committed
Introduce olcsx namespace for the exported typedefs from the library.
All typedefs marked `@api` must be moved here to prevent closure minification.
1 parent 99e4a98 commit ed688ca

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

build/ol3cesium.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
"compile": {
66
"externs": [
77
"ol3/build/ol-externs.js",
8+
"externs/olcsx.js",
89
"Cesium.externs.js"
910
],
1011
"define": [
1112
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
1213
"goog.DEBUG=true"
1314
],
15+
"js": [
16+
],
1417
"jscomp_error": [
1518
"accessControls",
1619
"ambiguousFunctionDecl",

externs/olcsx.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Ol3-Cesium typedef externs, sorted alphabetically
2+
3+
/**
4+
* @type {Object}
5+
*/
6+
var olcsx;
7+
8+
/**
9+
* Core namespace.
10+
* @type {Object}
11+
*/
12+
olcsx.core;
13+
14+
15+
/**
16+
* Context for feature conversion.
17+
* @typedef {{
18+
* projection: (!(ol.proj.Projection|string)),
19+
* primitives: (!Cesium.PrimitiveCollection),
20+
* featureToCesiumMap: (Object.<
21+
* number,
22+
* !Cesium.Primitive|!Cesium.Billboard>),
23+
* billboards: (!Cesium.BillboardCollection)
24+
* }}
25+
* @api
26+
*/
27+
olcsx.core.OlFeatureToCesiumContext;

src/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ goog.require('olcs.core.OlLayerPrimitive');
983983
* Convert one OpenLayers feature up to a collection of Cesium primitives.
984984
* @param {!ol.Feature} feature Ol3 feature.
985985
* @param {!ol.style.Style} style
986-
* @param {!olcs.core.OlFeatureToCesiumContext} context
986+
* @param {!olcsx.core.OlFeatureToCesiumContext} context
987987
* @param {!ol.geom.Geometry=} opt_geom Geometry to be converted.
988988
* @return {Cesium.Primitive} primitives
989989
* @api

src/core/ollayerprimitive.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
goog.provide('olcs.core.OlLayerPrimitive');
22

33

4-
/**
5-
* Context for feature conversion.
6-
* @typedef {{
7-
* projection: (!(ol.proj.Projection|string)),
8-
* primitives: (!Cesium.PrimitiveCollection),
9-
* featureToCesiumMap: (Object.<
10-
* number,
11-
* !Cesium.Primitive|!Cesium.Billboard>),
12-
* billboards: (!Cesium.BillboardCollection)
13-
* }}
14-
* @api
15-
*/
16-
olcs.core.OlFeatureToCesiumContext;
17-
18-
194

205
/**
216
* Result of the conversion of an OpenLayers layer to Cesium.
@@ -30,7 +15,7 @@ olcs.core.OlLayerPrimitive = function(layerProjection) {
3015
var primitives = new Cesium.PrimitiveCollection();
3116

3217
/**
33-
* @type {!olcs.core.OlFeatureToCesiumContext}
18+
* @type {!olcsx.core.OlFeatureToCesiumContext}
3419
*/
3520
this.context = {
3621
projection: layerProjection,

0 commit comments

Comments
 (0)