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
+9 -11
View File
@@ -11,14 +11,12 @@ import OSM from '../src/ol/source/OSM.js';
* @param {string} divId The id of the div for the map.
* @return {ol.PluggableMap} The ol.Map instance.
*/
var createMap = function(divId) {
var source, layer, map, zoomslider;
source = new OSM();
layer = new TileLayer({
function createMap(divId) {
const source = new OSM();
const layer = new TileLayer({
source: source
});
map = new Map({
const map = new Map({
layers: [layer],
target: divId,
view: new View({
@@ -26,11 +24,11 @@ var createMap = function(divId) {
zoom: 2
})
});
zoomslider = new ZoomSlider();
const zoomslider = new ZoomSlider();
map.addControl(zoomslider);
return map;
};
}
var map1 = createMap('map1');
var map2 = createMap('map2');
var map3 = createMap('map3');
const map1 = createMap('map1');
const map2 = createMap('map2');
const map3 = createMap('map3');