From ef8a54d551bba82bc4bc34160367afe95b7c1ea5 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 4 Sep 2017 08:53:06 +0200 Subject: [PATCH 1/9] Update eslint --- examples/vectors.js | 18 +++++++++--------- package.json | 4 ++-- src/olcesium.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/vectors.js b/examples/vectors.js index da1c6ab4f..0c36fceb5 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); diff --git a/package.json b/package.json index 53d5723dd..f29f2e0c2 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "@camptocamp/cesium": "1.36.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; From a2ff4bfa8734a76a906ea3642baff85d2ca9f7ef Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 4 Sep 2017 08:53:33 +0200 Subject: [PATCH 2/9] Update OpenLayers and Cesium --- CHANGES.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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/package.json b/package.json index f29f2e0c2..d2c961045 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@camptocamp/closure-util": "1.23.0", - "openlayers": "4.3.1", + "openlayers": "4.3.2", "@camptocamp/cesium": "1.36.0", "@mapbox/geojsonhint": "2.0.1", "fs-extra": "3.0.1", From 8419fc7358f4b5a9ced744261c4e5e57a8867e44 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 4 Sep 2017 08:53:54 +0200 Subject: [PATCH 3/9] Bump major version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2c961045..0a1288949 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": { From 5222a6c2e0cf0fa81333c07d9c6c1e06cc87c475 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Sep 2017 07:53:22 +0200 Subject: [PATCH 4/9] Port to Cesium 1.37 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a1288949..224f6fb38 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@camptocamp/closure-util": "1.23.0", "openlayers": "4.3.2", - "@camptocamp/cesium": "1.36.0", + "@camptocamp/cesium": "1.37.0", "@mapbox/geojsonhint": "2.0.1", "fs-extra": "3.0.1", "jsdoc": "3.5.4", From fbc2f23e7395dfa3de5e089f8a42d9e46a6f299a Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Sep 2017 08:21:13 +0200 Subject: [PATCH 5/9] Fix build rule Depend on the actual timestamp file to avoid systematic rebuilds. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 3eed8db76786b5c9441cd76aadbf4f94c61ac421 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Sep 2017 08:21:30 +0200 Subject: [PATCH 6/9] Fix lazy load of Cesium in examples --- examples/inject_ol_cesium.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From 9d32507c6e30b50247a07aa50a70514d5682f6bc Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Sep 2017 08:21:44 +0200 Subject: [PATCH 7/9] Start main example with 3D enabled --- examples/main.js | 1 + 1 file changed, 1 insertion(+) 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'; From 9b1bc9745bf618f4349022fd52644ffca322c411 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Sep 2017 08:22:58 +0200 Subject: [PATCH 8/9] Improve rotate example - add a rotate map button; - starts closer to the ground. --- examples/rotate.html | 1 + examples/rotate.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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 */ From 6e760e6b9bb93af1f566c4818ea82d449831ed44 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Sep 2017 08:23:18 +0200 Subject: [PATCH 9/9] Stop lighting the vector example --- examples/vectors.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/vectors.js b/examples/vectors.js index 0c36fceb5..b2377fddf 100644 --- a/examples/vectors.js +++ b/examples/vectors.js @@ -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();