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
+7 -7
View File
@@ -10,15 +10,15 @@ import TileJSON from '../src/ol/source/TileJSON.js';
/**
* Elements that make up the popup.
*/
var container = document.getElementById('popup');
var content = document.getElementById('popup-content');
var closer = document.getElementById('popup-closer');
const container = document.getElementById('popup');
const content = document.getElementById('popup-content');
const closer = document.getElementById('popup-closer');
/**
* Create an overlay to anchor the popup to the map.
*/
var overlay = new Overlay({
const overlay = new Overlay({
element: container,
autoPan: true,
autoPanAnimation: {
@@ -41,7 +41,7 @@ closer.onclick = function() {
/**
* Create the map.
*/
var map = new Map({
const map = new Map({
layers: [
new TileLayer({
source: new TileJSON({
@@ -63,8 +63,8 @@ var map = new Map({
* Add a click handler to the map to render the popup.
*/
map.on('singleclick', function(evt) {
var coordinate = evt.coordinate;
var hdms = _ol_coordinate_.toStringHDMS(toLonLat(coordinate));
const coordinate = evt.coordinate;
const hdms = _ol_coordinate_.toStringHDMS(toLonLat(coordinate));
content.innerHTML = '<p>You clicked here:</p><code>' + hdms +
'</code>';