diff --git a/CHANGES.md b/CHANGES.md
index c7b6f2d2c..07bf59e53 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,6 +3,8 @@
# v 1.31
* Changes
+ * Port to OpenLayers 4.3.2
+ * Port to Cesium 1.37
* Update OpenLayers to v4.3.1 to fix https://github.com/openlayers/ol-cesium/issues/479
* Get OpenLayers and Cesium dependencies through npm instead of git
submodules. On old clones you must remove manually the unused "ol" and
diff --git a/Makefile b/Makefile
index eb5c329a1..8430e2c9a 100644
--- a/Makefile
+++ b/Makefile
@@ -93,13 +93,13 @@ cleanall: clean
for f in dist/examples/*.html; do $(SEDI) 'sY../node_modules/openlayers/css/ol.cssY../ol.cssY' $$f; done
touch $@
-dist/olcesium-debug.js: build/olcesium-debug.json $(SRC_JS_FILES) Cesium.externs.js build/build.js npm-install
+dist/olcesium-debug.js: build/olcesium-debug.json $(SRC_JS_FILES) Cesium.externs.js build/build.js .build/node_modules.timestamp
mkdir -p $(dir $@)
node build/build.js $< $@
# A sourcemap is prepared, the source is exected to be deployed in 'source' directory
-dist/olcesium.js: build/olcesium.json $(SRC_JS_FILES) Cesium.externs.js build/build.js npm-install
+dist/olcesium.js: build/olcesium.json $(SRC_JS_FILES) Cesium.externs.js build/build.js .build/node_modules.timestamp
mkdir -p $(dir $@)
node build/build.js $< $@
$(SEDI) 's!$(shell pwd)/dist!source!g' dist/olcesium.js.map
diff --git a/examples/inject_ol_cesium.js b/examples/inject_ol_cesium.js
index b2e862eed..f8ac79e4e 100644
--- a/examples/inject_ol_cesium.js
+++ b/examples/inject_ol_cesium.js
@@ -15,7 +15,7 @@
if (!s) {
s = document.createElement('script');
s.type = 'text/javascript';
- s.src = `../cesium/Build/${cs}`;
+ s.src = `../node_modules/@camptocamp/cesium/Build/${cs}`;
console.log('loading Cesium...');
document.body.appendChild(s);
}
diff --git a/examples/main.js b/examples/main.js
index 76de9b5a1..1430f11e6 100644
--- a/examples/main.js
+++ b/examples/main.js
@@ -35,6 +35,7 @@ const terrainProvider = new Cesium.CesiumTerrainProvider({
requestVertexNormals: true
});
scene.terrainProvider = terrainProvider;
+ol3d.setEnabled(true);
timeElt.style.display = 'none';
diff --git a/examples/rotate.html b/examples/rotate.html
index 4c1521709..9544b1f13 100644
--- a/examples/rotate.html
+++ b/examples/rotate.html
@@ -12,6 +12,7 @@
+
Animated rotation a la Google Map.
diff --git a/examples/rotate.js b/examples/rotate.js
index c45a9a2b1..0bfb4eec4 100644
--- a/examples/rotate.js
+++ b/examples/rotate.js
@@ -12,8 +12,8 @@ const map = new ol.Map({
})
}),
view: new ol.View({
- center: [0, 0],
- zoom: 2
+ center: [333333, 1500000],
+ zoom: 6
})
});
@@ -119,6 +119,12 @@ OlcsControl.prototype.resetToNorthZenith = function(callback) {
};
+OlcsControl.prototype.rotate = function(angle) {
+ const current = this.ol3d_.getOlMap().getView().getRotation();
+ this.ol3d_.getOlMap().getView().setRotation(current + angle);
+};
+
+
/**
* @param {number} angle
*/
diff --git a/examples/vectors.js b/examples/vectors.js
index da1c6ab4f..b2377fddf 100644
--- a/examples/vectors.js
+++ b/examples/vectors.js
@@ -48,15 +48,15 @@ const textStyle = [new ol.style.Style({
})
})
}), new ol.style.Style({
- geometry: new ol.geom.Circle([1000000, 3000000, 10000], 2e6),
- stroke: new ol.style.Stroke({
- color: 'blue',
- width: 2
- }),
- fill: new ol.style.Fill({
- color: 'rgba(0, 0, 255, 0.2)'
- })
- })];
+ geometry: new ol.geom.Circle([1000000, 3000000, 10000], 2e6),
+ stroke: new ol.style.Stroke({
+ color: 'blue',
+ width: 2
+ }),
+ fill: new ol.style.Fill({
+ color: 'rgba(0, 0, 255, 0.2)'
+ })
+})];
iconFeature.setStyle(iconStyle);
@@ -256,11 +256,9 @@ dragAndDropInteraction.on('addfeatures', (event) => {
const ol3d = new olcs.OLCesium({map, target: 'map3d'});
const scene = ol3d.getCesiumScene();
const terrainProvider = new Cesium.CesiumTerrainProvider({
- url: '//assets.agi.com/stk-terrain/world',
- requestVertexNormals: true
+ url: '//assets.agi.com/stk-terrain/world'
});
scene.terrainProvider = terrainProvider;
-scene.globe.enableLighting = true;
ol3d.setEnabled(true);
const csLabels = new Cesium.LabelCollection();
diff --git a/package.json b/package.json
index 53d5723dd..224f6fb38 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ol-cesium",
- "version": "1.30.0",
+ "version": "1.31.0",
"description": "OpenLayers Cesium integration library",
"scripts": {},
"repository": {
@@ -17,12 +17,12 @@
},
"devDependencies": {
"@camptocamp/closure-util": "1.23.0",
- "openlayers": "4.3.1",
- "@camptocamp/cesium": "1.36.0",
+ "openlayers": "4.3.2",
+ "@camptocamp/cesium": "1.37.0",
"@mapbox/geojsonhint": "2.0.1",
"fs-extra": "3.0.1",
- "jsdoc": "~3.4.0",
- "eslint": "4.1.1",
+ "jsdoc": "3.5.4",
+ "eslint": "4.6.1",
"eslint-config-openlayers": "7.0.0",
"nomnom": "1.8.1",
"temp": "0.8.3",
diff --git a/src/olcesium.js b/src/olcesium.js
index bd160e57b..c5988ccde 100644
--- a/src/olcesium.js
+++ b/src/olcesium.js
@@ -139,7 +139,7 @@ olcs.OLCesium = function(options) {
this.hiddenRootGroup_ = null;
const sceneOptions = options.sceneOptions !== undefined ? options.sceneOptions :
- /** @type {Cesium.SceneOptions} */ ({});
+ /** @type {Cesium.SceneOptions} */ ({});
sceneOptions.canvas = this.canvas_;
sceneOptions.scene3DOnly = true;