Skip to content

Commit 7b98d3a

Browse files
committed
Merge pull request #148 from openlayers/revert-147-custom-synchronizers
Revert "Allow working with custom synchronizers"
2 parents 03df63a + 86e0ae2 commit 7b98d3a

File tree

4 files changed

+26
-77
lines changed

4 files changed

+26
-77
lines changed

build/jsdoc/api/conf.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"includePattern": ".+\\.js(doc)?$",
1111
"excludePattern": "(^|\\/|\\\\)_",
1212
"include": [
13-
"src",
14-
"externs"
13+
"src"
1514
]
1615
},
1716
"plugins": [

build/jsdoc/api/plugins/typedefs.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
2-
* Converts olcsx.js @type annotations into properties of the previous @typedef.
2+
* Converts olx.js @type annotations into properties of the previous @typedef.
33
* Changes @enum annotations into @typedef.
44
*/
55

6-
var lastOlcsxTypedef = null;
7-
var olcsxTypes = {};
6+
var lastOlxTypedef = null;
7+
var olxTypes = {};
88

99
function addSubparams(params) {
1010
for (var j = 0, jj = params.length; j < jj; ++j) {
1111
var param = params[j];
1212
var types = param.type.names;
1313
for (var k = 0, kk = types.length; k < kk; ++k) {
1414
var name = types[k];
15-
if (name in olcsxTypes) {
16-
param.subparams = olcsxTypes[name];
15+
if (name in olxTypes) {
16+
param.subparams = olxTypes[name];
1717
// TODO addSubparams(param.subparams);
1818
// TODO Do we need to support multiple object literal types per
1919
// param?
@@ -27,20 +27,20 @@ exports.handlers = {
2727

2828
newDoclet: function(e) {
2929
var doclet = e.doclet;
30-
if (doclet.meta.filename == 'olcsx.js') {
30+
if (doclet.meta.filename == 'olx.js') {
3131
// do nothing if not marked @api
3232
if (!doclet.stability) {
3333
return;
3434
}
3535
if (doclet.kind == 'typedef') {
36-
lastOlcsxTypedef = doclet;
37-
olcsxTypes[doclet.longname] = [];
36+
lastOlxTypedef = doclet;
37+
olxTypes[doclet.longname] = [];
3838
doclet.properties = [];
39-
} else if (lastOlcsxTypedef && doclet.memberof == lastOlcsxTypedef.longname) {
40-
lastOlcsxTypedef.properties.push(doclet);
41-
olcsxTypes[lastOlcsxTypedef.longname].push(doclet);
39+
} else if (lastOlxTypedef && doclet.memberof == lastOlxTypedef.longname) {
40+
lastOlxTypedef.properties.push(doclet);
41+
olxTypes[lastOlxTypedef.longname].push(doclet);
4242
} else {
43-
lastOlcsxTypedef = null;
43+
lastOlxTypedef = null;
4444
}
4545
} else if (doclet.isEnum) {
4646
// We never export enums, so we document them like typedefs

externs/olcsx.js

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,6 @@
55
*/
66
var olcsx;
77

8-
9-
/**
10-
* @typedef {{
11-
* map: (!ol.Map),
12-
* target: (Element|string|undefined),
13-
* createSynchronizers: ((function(!ol.Map, !Cesium.Scene): Array.<olcs.AbstractSynchronizer>)|undefined)
14-
* }}
15-
* @api
16-
*/
17-
olcsx.OLCesiumOptions;
18-
19-
20-
/**
21-
* The OpenLayers map we want to show on a Cesium scene.
22-
* @type {!ol.Map}
23-
* @api
24-
*/
25-
olcsx.OLCesiumOptions.prototype.map;
26-
27-
28-
/**
29-
* Target element for the Cesium scene.
30-
* @type {Element|string|undefined}
31-
* @api
32-
*/
33-
olcsx.OLCesiumOptions.prototype.target;
34-
35-
36-
/**
37-
* Callback function which will be called by the {@link olcs.OLCesium}
38-
* constructor to create custom synchronizers. Receives an `ol.Map` and a
39-
* `Cesium.Scene` as arguments, and needs to return an array of
40-
* {@link olcs.AbstractSynchronizer}.
41-
* @type {undefined|function(!ol.Map, !Cesium.Scene): Array.<olcs.AbstractSynchronizer>}
42-
* @api
43-
*/
44-
olcsx.OLCesiumOptions.prototype.createSynchronizers;
45-
46-
478
/**
489
* Core namespace.
4910
* @type {Object}

src/ol3cesium.js

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,12 @@ goog.require('olcs.VectorSynchronizer');
1111

1212

1313
/**
14-
* @param {!(olcsx.OLCesiumOptions|ol.Map)} options Options.
14+
* @param {!ol.Map} map
1515
* @param {Element|string=} opt_target Target element for the Cesium container.
16-
* Use the `target` option in `options` instead.
1716
* @constructor
1817
* @api
1918
*/
20-
olcs.OLCesium = function(options, opt_target) {
21-
22-
var map, createSynchronizers;
23-
var target = opt_target;
24-
if (options instanceof ol.Map) {
25-
map = options;
26-
} else {
27-
map = options.map;
28-
target = options.target;
29-
createSynchronizers = options.createSynchronizers;
30-
}
31-
19+
olcs.OLCesium = function(map, opt_target) {
3220
/**
3321
* @type {!ol.Map}
3422
* @private
@@ -44,7 +32,7 @@ olcs.OLCesium = function(options, opt_target) {
4432
this.container_ = goog.dom.createDom(goog.dom.TagName.DIV,
4533
{style: fillArea + 'visibility:hidden;'});
4634

47-
var targetElement = goog.dom.getElement(target || null);
35+
var targetElement = goog.dom.getElement(opt_target || null);
4836
if (targetElement) {
4937
goog.dom.appendChild(targetElement, this.container_);
5038
} else {
@@ -133,16 +121,17 @@ olcs.OLCesium = function(options, opt_target) {
133121
this.scene_.globe = this.globe_;
134122
this.scene_.skyAtmosphere = new Cesium.SkyAtmosphere();
135123

136-
var synchronizers = goog.isDef(createSynchronizers) ?
137-
createSynchronizers(this.map_, this.scene_) :
138-
[
139-
new olcs.RasterSynchronizer(this.map_, this.scene_),
140-
new olcs.VectorSynchronizer(this.map_, this.scene_)
141-
];
124+
/**
125+
* @type {!olcs.RasterSynchronizer}
126+
* @private
127+
*/
128+
this.rasterSynchronizer_ = new olcs.RasterSynchronizer(this.map_,
129+
this.scene_);
130+
this.rasterSynchronizer_.synchronize();
142131

143-
for (var i = synchronizers.length - 1; i >= 0; --i) {
144-
synchronizers[i].synchronize();
145-
}
132+
this.vectorSynchronizer_ = new olcs.VectorSynchronizer(this.map_,
133+
this.scene_);
134+
this.vectorSynchronizer_.synchronize();
146135

147136
if (this.isOverMap_) {
148137
// if in "stacked mode", hide everything except canvas (including credits)

0 commit comments

Comments
 (0)