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:
@@ -4,7 +4,7 @@ import Control from '../../../../src/ol/control/Control.js';
|
||||
import OverviewMap from '../../../../src/ol/control/OverviewMap.js';
|
||||
|
||||
describe('ol.control.OverviewMap', function() {
|
||||
var map, target;
|
||||
let map, target;
|
||||
|
||||
beforeEach(function() {
|
||||
target = document.createElement('div');
|
||||
@@ -23,7 +23,7 @@ describe('ol.control.OverviewMap', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
it('creates an overview map with the default options', function() {
|
||||
var control = new OverviewMap();
|
||||
const control = new OverviewMap();
|
||||
expect(control).to.be.a(OverviewMap);
|
||||
expect(control).to.be.a(Control);
|
||||
});
|
||||
@@ -32,16 +32,16 @@ describe('ol.control.OverviewMap', function() {
|
||||
describe('setMap()', function() {
|
||||
|
||||
it('keeps ovmap view rotation in sync with map view rotation', function() {
|
||||
var view = new View({
|
||||
const view = new View({
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
rotation: 0
|
||||
});
|
||||
map.setView(view);
|
||||
|
||||
var control = new OverviewMap();
|
||||
const control = new OverviewMap();
|
||||
map.addControl(control);
|
||||
var ovView = control.ovmap_.getView();
|
||||
const ovView = control.ovmap_.getView();
|
||||
expect(ovView.getRotation()).to.be(0);
|
||||
|
||||
view.setRotation(Math.PI / 4);
|
||||
@@ -49,12 +49,12 @@ describe('ol.control.OverviewMap', function() {
|
||||
});
|
||||
|
||||
it('maintains rotation in sync if view added later', function() {
|
||||
var control = new OverviewMap();
|
||||
const control = new OverviewMap();
|
||||
map.addControl(control);
|
||||
var ovView = control.ovmap_.getView();
|
||||
const ovView = control.ovmap_.getView();
|
||||
expect(ovView.getRotation()).to.be(0);
|
||||
|
||||
var view = new View({
|
||||
const view = new View({
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
rotation: 0
|
||||
@@ -65,10 +65,10 @@ describe('ol.control.OverviewMap', function() {
|
||||
});
|
||||
|
||||
it('stops listening to old maps', function() {
|
||||
var control = new OverviewMap();
|
||||
var ovView = control.ovmap_.getView();
|
||||
const control = new OverviewMap();
|
||||
const ovView = control.ovmap_.getView();
|
||||
|
||||
var view = new View({
|
||||
const view = new View({
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
rotation: 0
|
||||
@@ -86,7 +86,7 @@ describe('ol.control.OverviewMap', function() {
|
||||
});
|
||||
|
||||
it('set target to null', function() {
|
||||
var control = new OverviewMap();
|
||||
const control = new OverviewMap();
|
||||
|
||||
map.addControl(control);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user