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
+6 -6
View File
@@ -3,22 +3,22 @@ import View from '../src/ol/View.js';
import TileLayer from '../src/ol/layer/Tile.js';
import OSM from '../src/ol/source/OSM.js';
var viewport = document.getElementById('map');
const viewport = document.getElementById('map');
function getMinZoom() {
var width = viewport.clientWidth;
const width = viewport.clientWidth;
return Math.ceil(Math.LOG2E * Math.log(width / 256));
}
var initialZoom = getMinZoom();
const initialZoom = getMinZoom();
var view = new View({
const view = new View({
center: [0, 0],
minZoom: initialZoom,
zoom: initialZoom
});
var map = new Map({
const map = new Map({
layers: [
new TileLayer({
source: new OSM()
@@ -29,7 +29,7 @@ var map = new Map({
});
window.addEventListener('resize', function() {
var minZoom = getMinZoom();
const minZoom = getMinZoom();
if (minZoom !== view.getMinZoom()) {
view.setMinZoom(minZoom);
}