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

@@ -21,10 +21,10 @@ import _ol_obj_ from '../obj.js';
* @param {olx.layer.VectorTileOptions=} opt_options Options.
* @api
*/
var VectorTileLayer = function(opt_options) {
var options = opt_options ? opt_options : {};
const VectorTileLayer = function(opt_options) {
const options = opt_options ? opt_options : {};
var renderMode = options.renderMode || _ol_layer_VectorTileRenderType_.HYBRID;
let renderMode = options.renderMode || _ol_layer_VectorTileRenderType_.HYBRID;
assert(renderMode == undefined ||
renderMode == _ol_layer_VectorTileRenderType_.IMAGE ||
renderMode == _ol_layer_VectorTileRenderType_.HYBRID ||
@@ -35,7 +35,7 @@ var VectorTileLayer = function(opt_options) {
}
options.renderMode = renderMode;
var baseOptions = _ol_obj_.assign({}, options);
const baseOptions = _ol_obj_.assign({}, options);
delete baseOptions.preload;
delete baseOptions.useInterimTilesOnError;
@@ -102,7 +102,7 @@ VectorTileLayer.prototype.setPreload = function(preload) {
*/
VectorTileLayer.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) {
this.set(
_ol_layer_TileProperty_.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
_ol_layer_TileProperty_.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
};