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:
@@ -11,7 +11,7 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
* Define a namespace for the application.
|
||||
*/
|
||||
window.app = {};
|
||||
var app = window.app;
|
||||
const app = window.app;
|
||||
|
||||
|
||||
//
|
||||
@@ -26,20 +26,20 @@ var app = window.app;
|
||||
*/
|
||||
app.RotateNorthControl = function(opt_options) {
|
||||
|
||||
var options = opt_options || {};
|
||||
const options = opt_options || {};
|
||||
|
||||
var button = document.createElement('button');
|
||||
const button = document.createElement('button');
|
||||
button.innerHTML = 'N';
|
||||
|
||||
var this_ = this;
|
||||
var handleRotateNorth = function() {
|
||||
const this_ = this;
|
||||
const handleRotateNorth = function() {
|
||||
this_.getMap().getView().setRotation(0);
|
||||
};
|
||||
|
||||
button.addEventListener('click', handleRotateNorth, false);
|
||||
button.addEventListener('touchstart', handleRotateNorth, false);
|
||||
|
||||
var element = document.createElement('div');
|
||||
const element = document.createElement('div');
|
||||
element.className = 'rotate-north ol-unselectable ol-control';
|
||||
element.appendChild(button);
|
||||
|
||||
@@ -57,7 +57,7 @@ inherits(app.RotateNorthControl, Control);
|
||||
//
|
||||
|
||||
|
||||
var map = new Map({
|
||||
const map = new Map({
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
|
||||
Reference in New Issue
Block a user