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

@@ -14,13 +14,13 @@ import Stroke from '../src/ol/style/Stroke.js';
import Style from '../src/ol/style/Style.js';
var image = new CircleStyle({
const image = new CircleStyle({
radius: 5,
fill: null,
stroke: new Stroke({color: 'red', width: 1})
});
var styles = {
const styles = {
'Point': new Style({
image: image
}),
@@ -85,11 +85,11 @@ var styles = {
})
};
var styleFunction = function(feature) {
const styleFunction = function(feature) {
return styles[feature.getGeometry().getType()];
};
var geojsonObject = {
const geojsonObject = {
'type': 'FeatureCollection',
'crs': {
'type': 'name',
@@ -160,18 +160,18 @@ var geojsonObject = {
}]
};
var vectorSource = new VectorSource({
const vectorSource = new VectorSource({
features: (new GeoJSON()).readFeatures(geojsonObject)
});
vectorSource.addFeature(new Feature(new Circle([5e6, 7e6], 1e6)));
var vectorLayer = new VectorLayer({
const vectorLayer = new VectorLayer({
source: vectorSource,
style: styleFunction
});
var map = new Map({
const map = new Map({
layers: [
new TileLayer({
source: new OSM()