Skip to content

Commit

Permalink
Merge pull request #658 from openlayers/prepare_for_2.3
Browse files Browse the repository at this point in the history
Prepare for 2.3
  • Loading branch information
gberaudo authored Sep 27, 2018
2 parents db913c2 + bc042d8 commit a3a64e1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 32 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Changelog

# v 2.3
# v 2.3 - 2018-09-27

* Changes
* Port to OpenLayers 5.2.0.
* Add image static support.
* Improve old fashioned build.
* Port to Cesium 1.49.

# v 2.2.2 - 2018-08-24

Expand Down
12 changes: 1 addition & 11 deletions buildtools/webpack.commons.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');


const babelPresets = [['env', {
const babelPresets = [['@babel/preset-env', {
'targets': {
'browsers': ['last 2 versions', 'Firefox ESR', 'ie 11'],
},
Expand Down Expand Up @@ -32,13 +31,6 @@ const olcsRule = {
}
};

const cssRule = {
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: 'css-loader'
})
};

const htmlRule = {
test: /\.html$/,
use: [{
Expand Down Expand Up @@ -66,13 +58,11 @@ const config = {
rules: [
olRule,
olcsRule,
cssRule,
htmlRule,
iconRule
]
},
plugins: [
new ExtractTextPlugin('[name].css')
],
resolve: {
modules: [
Expand Down
7 changes: 2 additions & 5 deletions examples/image-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Static from 'ol/source/ImageStatic.js';

const imageExtent = [-40, 50, -10, 65];

Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0MzAyNzUyYi0zY2QxLTQxZDItODRkOS1hNTA3MDU3ZTBiMDUiLCJpZCI6MjU0MSwiaWF0IjoxNTMzNjI1MTYwfQ.oHn1SUWJa12esu7XUUtEoc1BbEbuZpRocLetw6M6_AA';
const ol2d = new olMap({
layers: [
new olLayerTile({
Expand Down Expand Up @@ -47,11 +48,7 @@ const ol3d = new OLCesium({
map: ol2d
});
const scene = ol3d.getCesiumScene();
const terrainProvider = new Cesium.CesiumTerrainProvider({
url: '//assets.agi.com/stk-terrain/world',
requestVertexNormals: true
});
scene.terrainProvider = terrainProvider;
scene.terrainProvider = Cesium.createWorldTerrain();
ol3d.setEnabled(true);


Expand Down
8 changes: 6 additions & 2 deletions examples/rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ OlcsControl.prototype.resetToNorthZenith = function(callback) {


OlcsControl.prototype.rotate = function(angle) {
const current = this.ol3d_.getOlView().getRotation();
this.ol3d_.getOlView().setRotation(current + angle);
const view = this.ol3d_.getOlView();
const current = view.getRotation();
view.animate({
rotation: current + angle,
duration: 250
});
};


Expand Down
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ol-cesium",
"version": "2.2.2",
"version": "2.3.0",
"description": "OpenLayers Cesium integration library",
"scripts": {
"build-examples": "cross-env NODE_ENV=production TARGET=examples webpack --progress --bail",
Expand All @@ -19,18 +19,16 @@
"url": "https://github.com/openlayers/ol-cesium/issues"
},
"devDependencies": {
"@camptocamp/cesium": "1.48.0",
"@babel/core": "7.1.0",
"@babel/preset-env": "7.1.0",
"@camptocamp/cesium": "1.49.0",
"@mapbox/geojsonhint": "2.0.1",
"babel-core": "6.26.3",
"babel-loader": "7.1.5",
"babel-preset-env": "1.7.0",
"babel-loader": "8.0.2",
"copy-webpack-plugin": "4.5.2",
"cross-env": "5.2.0",
"css-loader": "1.0.0",
"eslint": "5.4.0",
"eslint": "5.6.0",
"eslint-config-openlayers": "11.0.0",
"eslint-import-resolver-webpack": "^0.10.1",
"extract-text-webpack-plugin": "4.0.0-alpha.0",
"fs-extra": "7.0.0",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.2.0",
Expand All @@ -41,9 +39,9 @@
"ol": "5.2.0",
"proj4": "2.4.4",
"temp": "0.8.3",
"webpack": "4.17.1",
"webpack-cli": "3.1.0",
"webpack-dev-server": "3.1.5",
"webpack-merge": "^4.1.4"
"webpack": "^4.20.2",
"webpack-cli": "3.1.1",
"webpack-dev-server": "3.1.9",
"webpack-merge": "4.1.4"
}
}
1 change: 1 addition & 0 deletions src/olcs/AutoRenderLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AutoRenderLoop {
*/
enable() {
this.scene_.requestRenderMode = true;
this.scene_.maximumRenderTimeChange = 1000;
for (const repaintKey of this.repaintEventNames_) {
this.canvas_.addEventListener(repaintKey, this._boundNotifyRepaintRequired, false);
}
Expand Down
3 changes: 2 additions & 1 deletion src/olcs/FeatureConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,13 +716,14 @@ class FeatureConverter {
cancellers[fuid] = canceller;

const listener = function() {
image.removeEventListener('load', listener);
if (!billboards.isDestroyed() && !cancelled) {
// Create billboard if the feature is still displayed on the map.
reallyCreateBillboard();
}
};

image.once('load', listener);
image.addEventListener('load', listener);
} else {
reallyCreateBillboard();
}
Expand Down

0 comments on commit a3a64e1

Please sign in to comment.