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

View File

@@ -1,7 +1,7 @@
/**
* @module ol/tilecoord
*/
var _ol_tilecoord_ = {};
const _ol_tilecoord_ = {};
/**
@@ -68,10 +68,10 @@ _ol_tilecoord_.hash = function(tileCoord) {
* @return {string} Quad key.
*/
_ol_tilecoord_.quadKey = function(tileCoord) {
var z = tileCoord[0];
var digits = new Array(z);
var mask = 1 << (z - 1);
var i, charCode;
const z = tileCoord[0];
const digits = new Array(z);
let mask = 1 << (z - 1);
let i, charCode;
for (i = 0; i < z; ++i) {
// 48 is charCode for 0 - '0'.charCodeAt(0)
charCode = 48;
@@ -94,15 +94,15 @@ _ol_tilecoord_.quadKey = function(tileCoord) {
* @return {boolean} Tile coordinate is within extent and zoom level range.
*/
_ol_tilecoord_.withinExtentAndZ = function(tileCoord, tileGrid) {
var z = tileCoord[0];
var x = tileCoord[1];
var y = tileCoord[2];
const z = tileCoord[0];
const x = tileCoord[1];
const y = tileCoord[2];
if (tileGrid.getMinZoom() > z || z > tileGrid.getMaxZoom()) {
return false;
}
var extent = tileGrid.getExtent();
var tileRange;
const extent = tileGrid.getExtent();
let tileRange;
if (!extent) {
tileRange = tileGrid.getFullTileRange(z);
} else {