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

@@ -6,7 +6,7 @@ import _ol_coordinate_ from '../src/ol/coordinate.js';
import TileLayer from '../src/ol/layer/Tile.js';
import OSM from '../src/ol/source/OSM.js';
var mousePositionControl = new MousePosition({
const mousePositionControl = new MousePosition({
coordinateFormat: _ol_coordinate_.createStringXY(4),
projection: 'EPSG:4326',
// comment the following two lines to have the mouse position
@@ -16,7 +16,7 @@ var mousePositionControl = new MousePosition({
undefinedHTML: ' '
});
var map = new Map({
const map = new Map({
controls: defaultControls({
attributionOptions: {
collapsible: false
@@ -34,13 +34,13 @@ var map = new Map({
})
});
var projectionSelect = document.getElementById('projection');
const projectionSelect = document.getElementById('projection');
projectionSelect.addEventListener('change', function(event) {
mousePositionControl.setProjection(event.target.value);
});
var precisionInput = document.getElementById('precision');
const precisionInput = document.getElementById('precision');
precisionInput.addEventListener('change', function(event) {
var format = _ol_coordinate_.createStringXY(event.target.valueAsNumber);
const format = _ol_coordinate_.createStringXY(event.target.valueAsNumber);
mousePositionControl.setCoordinateFormat(format);
});