Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix lint errors #2511

Benjamin Kingc71f6313be97
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 0f452632e..b24175106 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -31,7 +31,7 @@ import {
export function mapLayerBuilder(models, config, cache, ui, store) {
const self = {};
- self.init = function () {
+ self.init = function() {
self.extentLayers = [];
};
@@ -83,7 +83,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
* @param {object} options - Layer options
* @returns {object} OpenLayers layer
*/
- self.createLayer = function (def, options) {
+ self.createLayer = function(def, options) {
const state = store.getState();
const activeDateStr = state.compare.isCompareA ? 'selected' : 'selectedB';
options = options || {};
@@ -143,7 +143,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
* @param {object} options Layer options
* @return {object} Closest date
*/
- self.getRequestDates = function (def, options) {
+ self.getRequestDates = function(def, options) {
const state = store.getState();
const activeDateStr = state.compare.isCompareA ? 'selected' : 'selectedB';
const stateCurrentDate = new Date(state.date[activeDateStr]);
@@ -203,7 +203,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
* @param {boolean} precache
* @returns {object} layer key Object
*/
- self.layerKey = function (def, options, state) {
+ self.layerKey = function(def, options, state) {
const { compare } = state;
var date;
var layerId = def.id;
@@ -291,7 +291,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
* @param {object} options - Layer options
* @returns {object} OpenLayers WMTS layer
*/
- const createLayerWMTS = function (def, options, day, state) {
+ const createLayerWMTS = function(def, options, day, state) {
const activeDateStr = state.compare.isCompareA ? 'selected' : 'selectedB';
const proj = state.proj.selected;
const source = config.sources[def.source];
@@ -354,9 +354,9 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
* @param {object} options - Layer options
* @returns {object} OpenLayers Vector layer
*/
- const createLayerVector = function (def, options, day, state) {
+ const createLayerVector = function(def, options, day, state) {
const { proj, compare } = state;
- let date, urlParameters, gridExtent, source, matrixSet, matrixIds, start, layerExtent;
+ var date, urlParameters, gridExtent, source, matrixSet, matrixIds, start, layerExtent;
const selectedProj = proj.selected;
const activeDateStr = compare.isCompareA ? 'selected' : 'selectedB';
const activeGroupStr = options.group ? options.group : compare.activeString;
@@ -375,7 +375,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
}
if (typeof def.matrixIds === 'undefined') {
matrixIds = [];
- lodashEach(matrixSet.resolutions, function (resolution, index) {
+ lodashEach(matrixSet.resolutions, function(resolution, index) {
matrixIds.push(index);
});
} else {
@@ -465,7 +465,7 @@ export function mapLayerBuilder(models, config, cache, ui, store) {
* @param {object} options - Layer options
* @returns {object} OpenLayers WMS layer
*/
- const createLayerWMS = function (def, options, day, state) {
+ const createLayerWMS = function(def, options, day, state) {
const { proj, compare } = state;
const activeDateStr = compare.isCompareA ? 'selected' : 'selectedB';
const selectedProj = proj.selected;
diff --git a/web/js/modules/vector-styles/selectors.js b/web/js/modules/vector-styles/selectors.js
index 27497f29b..bf9aa7d57 100644
--- a/web/js/modules/vector-styles/selectors.js
+++ b/web/js/modules/vector-styles/selectors.js
@@ -54,7 +54,7 @@ export function findIndex(layerId, type, value, index, groupStr, state) {
index = index || 0;
var values = getVectorStyle(layerId, index, groupStr, state).entries.values;
var result;
- lodashEach(values, function (check, index) {
+ lodashEach(values, function(check, index) {
var min = getMinValue(check);
var max = getMaxValue(check);
if (type === 'min' && value === min) {
@@ -101,7 +101,7 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state)
: null;
}
}
- lodashEach(activeLayers, function (def) {
+ lodashEach(activeLayers, function(def) {
if (state.compare && state.compare.active) {
if (layerGroup && layerGroup.getLayers().getArray().length) {
lodashEach(layerGroup.getLayers().getArray(), subLayer => {
@@ -119,7 +119,7 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state)
}
});
}
- let layerArray = layer.getLayers ? layer.getLayers().getArray() : [layer]
+ const layerArray = layer.getLayers ? layer.getLayers().getArray() : [layer];
lodashEach(layerArray, layerInLayerGroup => {
// Apply mapbox-gl styles
const extentStartX = layerInLayerGroup.getExtent()[0];
@@ -129,14 +129,14 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state)
// Filter Orbit Tracks
if (glStyle.name === 'Orbit Tracks') {
// Filter time by 5 mins
- layerInLayerGroup.setStyle(function (feature, resolution) {
+ layerInLayerGroup.setStyle(function(feature, resolution) {
var minute;
var minutes = feature.get('label');
if (minutes) {
minute = minutes.split(':');
}
- if (((minute && minute[1] % 5 === 0) || feature.getType() === 'LineString')
- && shouldRenderFeature(feature, acceptableExtent)) {
+ if (((minute && minute[1] % 5 === 0) || feature.getType() === 'LineString') &&
+ shouldRenderFeature(feature, acceptableExtent)) {
return styleFunction(feature, resolution);
}
});
@@ -144,7 +144,7 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state)
((selected[layerId] && selected[layerId].length))) {
const selectedFeatures = selected[layerId];
- layerInLayerGroup.setStyle(function (feature, resolution) {
+ layerInLayerGroup.setStyle(function(feature, resolution) {
const data = state.config.vectorData[def.vectorData.id];
const properties = data.mvt_properties;
const features = feature.getProperties();
@@ -159,7 +159,7 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state)
}
});
} else if (acceptableExtent) {
- layerInLayerGroup.setStyle(function (feature, resolution) {
+ layerInLayerGroup.setStyle(function(feature, resolution) {
if (shouldRenderFeature(feature, acceptableExtent)) {
return styleFunction(feature, resolution);
}
@@ -173,8 +173,7 @@ const shouldRenderFeature = (feature, acceptableExtent) => {
const midpoint = feature.getFlatCoordinates();
if (containsCoordinate(acceptableExtent, midpoint)) return true;
return false;
-
-}
+};
export function getKey(layerId, groupStr, state) {
groupStr = groupStr || state.compare.activeString;
if (!isActive(layerId, groupStr, state)) {
@@ -215,7 +214,7 @@ export function clearStyleFunction(def, vectorStyleId, vectorStyles, layer, stat
styleFunction = stylefunction(layer, glStyle, vectorStyleId);
if (glStyle.name === 'Orbit Tracks') {
// Filter time by 5 mins
- layer.setStyle(function (feature, resolution) {
+ layer.setStyle(function(feature, resolution) {
var minute;
var minutes = feature.get('label');
if (minutes) {