Skip to content

Commit

Permalink
Merge pull request #584 from openlayers/fix_inject_ol_cesium
Browse files Browse the repository at this point in the history
Use ES5 in examples/inject_ol_cesium.js
  • Loading branch information
gberaudo authored May 4, 2018
2 parents 3724780 + 516ca63 commit 20e5d4a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions examples/inject_ol_cesium.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// This file is ES5 on purpose.
// It does not go through webpack; it is directly loaded by the html.
(function() {
const mode = window.location.href.match(/mode=([a-z0-9\-]+)\&?/i);
const isDev = mode && mode[1] === 'dev';
/* eslint-disable no-var */
var mode = window.location.href.match(/mode=([a-z0-9\-]+)\&?/i);
var isDev = mode && mode[1] === 'dev';
window.IS_DEV = isDev;
const cs = isDev ? 'CesiumUnminified/Cesium.js' : 'Cesium/Cesium.js';
var cs = isDev ? 'CesiumUnminified/Cesium.js' : 'Cesium/Cesium.js';

window.CESIUM_URL = `../node_modules/@camptocamp/cesium/Build/${cs}`;
if (!window.LAZY_CESIUM) {
document.write(`<scr${'i'}pt type="text/javascript" src="${window.CESIUM_URL}"></scr${'i'}pt>`);
}

/* eslint-enable no-var */
})();

0 comments on commit 20e5d4a

Please sign in to comment.