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

@@ -3,18 +3,18 @@ import View from '../src/ol/View.js';
import TileLayer from '../src/ol/layer/Tile.js';
import XYZ from '../src/ol/source/XYZ.js';
var url = 'https://{a-c}.tiles.mapbox.com/v3/mapbox.world-bright/{z}/{x}/{y}.png';
const url = 'https://{a-c}.tiles.mapbox.com/v3/mapbox.world-bright/{z}/{x}/{y}.png';
var withTransition = new TileLayer({
const withTransition = new TileLayer({
source: new XYZ({url: url})
});
var withoutTransition = new TileLayer({
const withoutTransition = new TileLayer({
source: new XYZ({url: url, transition: 0}),
visible: false
});
var map = new Map({
const map = new Map({
layers: [withTransition, withoutTransition],
target: 'map',
view: new View({
@@ -25,7 +25,7 @@ var map = new Map({
});
document.getElementById('transition').addEventListener('change', function(event) {
var transition = event.target.checked;
const transition = event.target.checked;
withTransition.setVisible(transition);
withoutTransition.setVisible(!transition);
});