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:
@@ -5,17 +5,17 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
var osm = new TileLayer({
|
||||
const osm = new TileLayer({
|
||||
source: new OSM()
|
||||
});
|
||||
var bing = new TileLayer({
|
||||
const bing = new TileLayer({
|
||||
source: new BingMaps({
|
||||
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
|
||||
imagerySet: 'Aerial'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new Map({
|
||||
const map = new Map({
|
||||
layers: [osm, bing],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
@@ -29,11 +29,11 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var swipe = document.getElementById('swipe');
|
||||
const swipe = document.getElementById('swipe');
|
||||
|
||||
bing.on('precompose', function(event) {
|
||||
var ctx = event.context;
|
||||
var width = ctx.canvas.width * (swipe.value / 100);
|
||||
const ctx = event.context;
|
||||
const width = ctx.canvas.width * (swipe.value / 100);
|
||||
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
@@ -42,7 +42,7 @@ bing.on('precompose', function(event) {
|
||||
});
|
||||
|
||||
bing.on('postcompose', function(event) {
|
||||
var ctx = event.context;
|
||||
const ctx = event.context;
|
||||
ctx.restore();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user