Use blocked scoped variables

In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
Tim Schaub
2018-01-11 23:32:36 -07:00
parent 0bf2b04dee
commit ad62739a6e
684 changed files with 18120 additions and 18184 deletions

View File

@@ -5,17 +5,17 @@ import TileLayer from '../src/ol/layer/Tile.js';
import BingMaps from '../src/ol/source/BingMaps.js';
import OSM from '../src/ol/source/OSM.js';
var osm = new TileLayer({
const osm = new TileLayer({
source: new OSM()
});
var bing = new TileLayer({
const bing = new TileLayer({
source: new BingMaps({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
})
});
var map = new Map({
const map = new Map({
layers: [osm, bing],
target: 'map',
controls: defaultControls({
@@ -29,11 +29,11 @@ var map = new Map({
})
});
var swipe = document.getElementById('swipe');
const swipe = document.getElementById('swipe');
bing.on('precompose', function(event) {
var ctx = event.context;
var width = ctx.canvas.width * (swipe.value / 100);
const ctx = event.context;
const width = ctx.canvas.width * (swipe.value / 100);
ctx.save();
ctx.beginPath();
@@ -42,7 +42,7 @@ bing.on('precompose', function(event) {
});
bing.on('postcompose', function(event) {
var ctx = event.context;
const ctx = event.context;
ctx.restore();
});