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

@@ -9,7 +9,7 @@ import Style from '../src/ol/style/Style.js';
import Text from '../src/ol/style/Text.js';
var style = new Style({
const style = new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
@@ -20,7 +20,7 @@ var style = new Style({
text: new Text()
});
var map = new Map({
const map = new Map({
layers: [
new VectorLayer({
renderMode: 'image',
@@ -41,7 +41,7 @@ var map = new Map({
})
});
var featureOverlay = new VectorLayer({
const featureOverlay = new VectorLayer({
source: new VectorSource(),
map: map,
style: new Style({
@@ -55,14 +55,14 @@ var featureOverlay = new VectorLayer({
})
});
var highlight;
var displayFeatureInfo = function(pixel) {
let highlight;
const displayFeatureInfo = function(pixel) {
var feature = map.forEachFeatureAtPixel(pixel, function(feature) {
const feature = map.forEachFeatureAtPixel(pixel, function(feature) {
return feature;
});
var info = document.getElementById('info');
const info = document.getElementById('info');
if (feature) {
info.innerHTML = feature.getId() + ': ' + feature.get('name');
} else {
@@ -85,7 +85,7 @@ map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
const pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel);
});