Skip to content

Commit

Permalink
Merge pull request #489 from openlayers/update_dependencies_for_1.31
Browse files Browse the repository at this point in the history
Update dependencies for 1.31 and a few cosmetic changes
  • Loading branch information
gberaudo authored Sep 6, 2017
2 parents 44e7471 + 6e760e6 commit b1a6634
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/inject_ol_cesium.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions examples/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const terrainProvider = new Cesium.CesiumTerrainProvider({
requestVertexNormals: true
});
scene.terrainProvider = terrainProvider;
ol3d.setEnabled(true);


timeElt.style.display = 'none';
Expand Down
1 change: 1 addition & 0 deletions examples/rotate.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<div id="map2d" style="width:600px;height:400px;float:left;"></div>
<div><input type="button" value="Reset to North" onclick="control.resetToNorthZenith(function() {console.log('end')})" /></div>
<div><input type="button" value="Tilt on globe" onclick="control.tiltOnGlobe(0.05)" /></div>
<div><input type="button" value="Rotate map" onclick="control.rotate(0.05)" /></div>
<div>Animated rotation a la Google Map.</div>
<script src="inject_ol_cesium.js"></script>
<script src="rotate.js"></script>
Expand Down
10 changes: 8 additions & 2 deletions examples/rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const map = new ol.Map({
})
}),
view: new ol.View({
center: [0, 0],
zoom: 2
center: [333333, 1500000],
zoom: 6
})
});

Expand Down Expand Up @@ -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
*/
Expand Down
22 changes: 10 additions & 12 deletions examples/vectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ol-cesium",
"version": "1.30.0",
"version": "1.31.0",
"description": "OpenLayers Cesium integration library",
"scripts": {},
"repository": {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/olcesium.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b1a6634

Please sign in to comment.