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:
@@ -39,19 +39,19 @@ import PinchZoom from './interaction/PinchZoom.js';
|
||||
*/
|
||||
export function defaults(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
var interactions = new Collection();
|
||||
const interactions = new Collection();
|
||||
|
||||
var kinetic = new Kinetic(-0.005, 0.05, 100);
|
||||
const kinetic = new Kinetic(-0.005, 0.05, 100);
|
||||
|
||||
var altShiftDragRotate = options.altShiftDragRotate !== undefined ?
|
||||
const altShiftDragRotate = options.altShiftDragRotate !== undefined ?
|
||||
options.altShiftDragRotate : true;
|
||||
if (altShiftDragRotate) {
|
||||
interactions.push(new DragRotate());
|
||||
}
|
||||
|
||||
var doubleClickZoom = options.doubleClickZoom !== undefined ?
|
||||
const doubleClickZoom = options.doubleClickZoom !== undefined ?
|
||||
options.doubleClickZoom : true;
|
||||
if (doubleClickZoom) {
|
||||
interactions.push(new DoubleClickZoom({
|
||||
@@ -60,20 +60,20 @@ export function defaults(opt_options) {
|
||||
}));
|
||||
}
|
||||
|
||||
var dragPan = options.dragPan !== undefined ? options.dragPan : true;
|
||||
const dragPan = options.dragPan !== undefined ? options.dragPan : true;
|
||||
if (dragPan) {
|
||||
interactions.push(new DragPan({
|
||||
kinetic: kinetic
|
||||
}));
|
||||
}
|
||||
|
||||
var pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate :
|
||||
const pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate :
|
||||
true;
|
||||
if (pinchRotate) {
|
||||
interactions.push(new PinchRotate());
|
||||
}
|
||||
|
||||
var pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
|
||||
const pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
|
||||
if (pinchZoom) {
|
||||
interactions.push(new PinchZoom({
|
||||
constrainResolution: options.constrainResolution,
|
||||
@@ -81,7 +81,7 @@ export function defaults(opt_options) {
|
||||
}));
|
||||
}
|
||||
|
||||
var keyboard = options.keyboard !== undefined ? options.keyboard : true;
|
||||
const keyboard = options.keyboard !== undefined ? options.keyboard : true;
|
||||
if (keyboard) {
|
||||
interactions.push(new KeyboardPan());
|
||||
interactions.push(new KeyboardZoom({
|
||||
@@ -90,7 +90,7 @@ export function defaults(opt_options) {
|
||||
}));
|
||||
}
|
||||
|
||||
var mouseWheelZoom = options.mouseWheelZoom !== undefined ?
|
||||
const mouseWheelZoom = options.mouseWheelZoom !== undefined ?
|
||||
options.mouseWheelZoom : true;
|
||||
if (mouseWheelZoom) {
|
||||
interactions.push(new MouseWheelZoom({
|
||||
@@ -99,7 +99,7 @@ export function defaults(opt_options) {
|
||||
}));
|
||||
}
|
||||
|
||||
var shiftDragZoom = options.shiftDragZoom !== undefined ?
|
||||
const shiftDragZoom = options.shiftDragZoom !== undefined ?
|
||||
options.shiftDragZoom : true;
|
||||
if (shiftDragZoom) {
|
||||
interactions.push(new DragZoom({
|
||||
|
||||
Reference in New Issue
Block a user