Interactive interface for browsing global, full-resolution satellite imagery
Elongate lodash names
Benjamin Kingb3381cce5692
diff --git a/web/js/data/handler.js b/web/js/data/handler.jsindex 8e0ecf87d..4e3735c41 100644--- a/web/js/data/handler.js+++ b/web/js/data/handler.js@@ -1,5 +1,4 @@import $ from 'jquery';-import loEach from 'lodash/each';import {dataCmrMockClient, dataCmrClient} from './cmr';diff --git a/web/js/data/map.js b/web/js/data/map.jsindex 497ec97ee..cda919602 100644--- a/web/js/data/map.js+++ b/web/js/data/map.js@@ -1,5 +1,5 @@import $ from 'jquery';-import loEach from 'lodash/each';+import lodashEach from 'lodash/each';import OlStyleStyle from 'ol/style/style';import OlStyleIcon from 'ol/style/icon';import OlStyleText from 'ol/style/text';@@ -205,7 +205,7 @@ export function dataMap(model, maps, config) {updateButtons();updateSwaths();updateGrid();- loEach(model.selectedGranules, function (granule) {+ lodashEach(model.selectedGranules, function (granule) {if (selectedFeatures[granule.id]) {selectionLayer.getSource().removeFeature(selectedFeatures[granule.id]);@@ -219,7 +219,7 @@ export function dataMap(model, maps, config) {buttonLayer.getSource().clear();var features = [];- loEach(granules, function (granule) {+ lodashEach(granules, function (granule) {if (!granule.centroid || !granule.centroid[model.crs]) {return;}@@ -246,17 +246,17 @@ export function dataMap(model, maps, config) {var maxDistance = (model.crs === CRS_WGS_84)? 270 : Number.POSITIVE_INFINITY;var features = [];- loEach(swaths, function (swath) {+ lodashEach(swaths, function (swath) {var lastGranule = null;- loEach(swath, function (granule) {+ lodashEach(swath, function (granule) {if (!lastGranule) {lastGranule = granule;return;}var polys1 = mapToPolys(lastGranule.geometry[model.crs]);var polys2 = mapToPolys(granule.geometry[model.crs]);- loEach(polys1, function (poly1) {- loEach(polys2, function (poly2) {+ lodashEach(polys1, function (poly1) {+ lodashEach(polys2, function (poly2) {var c1 = poly1.getInteriorPoint().getCoordinates();var c2 = poly2.getInteriorPoint()@@ -284,7 +284,7 @@ export function dataMap(model, maps, config) {}var features = [];var parser = new OlFormatGeoJSON();- loEach(grid, function (cell) {+ lodashEach(grid, function (cell) {var geom = parser.readGeometry(cell.geometry);var feature = new OlFeature(geom);features.push(feature);diff --git a/web/js/data/model.js b/web/js/data/model.jsindex 6c2ca041b..d679589e7 100644--- a/web/js/data/model.js+++ b/web/js/data/model.js@@ -1,6 +1,6 @@import $ from 'jquery';-import loEach from 'lodash/each';-import loFind from 'lodash/find';+import lodashEach from 'lodash/each';+import lodashFind from 'lodash/find';import util from '../util/util';import {dataHandlerGetByName} from './handler';@@ -167,7 +167,7 @@ export function dataModel(models, config) {// especially for IE9. This whole function needs clean up.var results = {};var none = products.__NO_PRODUCT;- loEach(products, function (product, key) {+ lodashEach(products, function (product, key) {if (key !== NO_PRODUCT_ID) {results[key] = product;}@@ -277,7 +277,7 @@ export function dataModel(models, config) {self.load = function (state, errors) {var productId = state.download;if (productId) {- var found = loFind(models.layers.active, {+ var found = lodashFind(models.layers.active, {product: productId});if (!found) {@@ -359,7 +359,7 @@ export function dataModel(models, config) {var updateLayers = function () {self.layers = [];var foundSelected = false;- loEach(models.layers.get(), function (layer) {+ lodashEach(models.layers.get(), function (layer) {var id = layer.id;var names = models.layers.getTitles(layer.id);var layerName = names.title;@@ -388,7 +388,7 @@ export function dataModel(models, config) {// FIXME: This is a hack for now and should be cleaned up when// everything changes to models.var products = self.groupByProducts();- loEach(self.selectedGranules, function (selected) {+ lodashEach(self.selectedGranules, function (selected) {if (!products[selected.product] &&!productActive(selected.product)) {self.unselectGranule(selected);@@ -398,7 +398,7 @@ export function dataModel(models, config) {var productActive = function (product) {var active = false;- loEach(layersModel.active, function (layer) {+ lodashEach(layersModel.active, function (layer) {if (layer.product === product) {active = true;return false;diff --git a/web/js/data/results.js b/web/js/data/results.jsindex 537ba75b5..6fc327553 100644--- a/web/js/data/results.js+++ b/web/js/data/results.js@@ -6,8 +6,8 @@ import OlFormatGeoJSON from 'ol/format/geojson';import OlGeomPolygon from 'ol/geom/polygon';import OlGeomPoint from 'ol/geom/point';import olExtent from 'ol/extent';-import loClone from 'lodash/clone';-import loEach from 'lodash/each';+import lodashClone from 'lodash/clone';+import lodashEach from 'lodash/each';import {dataCmrRoundTime, dataCmrGeometry} from './cmr';import util from '../util/util';import {dataHelper} from '../edsc';@@ -300,7 +300,7 @@ export function dataResultsDensify() {var newGeom = null;if ( geom.getPolygons ) {var polys = [];- loEach(geom.getPolygons(), function(poly) {+ lodashEach(geom.getPolygons(), function(poly) {polys.push(densifyPolygon(poly));});newGeom = new OlGeomMultiPolygon([polys]);@@ -324,7 +324,7 @@ export function dataResultsDensify() {end = ring[i + 1];var distance = mapDistance2D(start, end);var numPoints = Math.floor(distance / MAX_DISTANCE);- points.push(loClone(start));+ points.push(lodashClone(start));for (var j = 1; j < numPoints - 1; j++) {var d = j / numPoints;// This is what REVERB does, so we will do the same@@ -332,7 +332,7 @@ export function dataResultsDensify() {points.push(p);}}- points.push(loClone(end));+ points.push(lodashClone(end));return points;};@@ -351,16 +351,16 @@ export function dataResultsDividePolygon() {var ring = granule.geometry['EPSG:4326'].getLinearRing(0);var coords = ring.getCoordinates();var latlons = [];- loEach(coords, function (coord) {+ lodashEach(coords, function (coord) {var latlon = new dataHelper.LatLng(coord[1], coord[0]);latlons.push(latlon);});var result = dataHelper.sphericalPolygon.dividePolygon(latlons);var newPolys = result.interiors;var resultMultiPoly = [];- loEach(newPolys, function (newPoly) {+ lodashEach(newPolys, function (newPoly) {var resultPoly = [];- loEach(newPoly, function (newCoord) {+ lodashEach(newPoly, function (newCoord) {resultPoly.push([newCoord.lng, newCoord.lat]);});resultMultiPoly.push(resultPoly);diff --git a/web/js/data/ui.js b/web/js/data/ui.jsindex a9d2bbf13..9080bef63 100644--- a/web/js/data/ui.js+++ b/web/js/data/ui.js@@ -1,6 +1,6 @@import $ from 'jquery';-import loSize from 'lodash/size';-import loEach from 'lodash/each';+import lodashSize from 'lodash/size';+import lodashEach from 'lodash/each';import {GA as GoogleAnalytics} from 'worldview-components';import olExtent from 'ol/extent';@@ -216,7 +216,7 @@ export function dataUi(models, ui, config) {var extent = map.getView().calculateExtent(map.getSize());var crs = models.proj.selected.crs;- loEach(lastResults.granules, function (granule) {+ lodashEach(lastResults.granules, function (granule) {if (granule.centroid && granule.centroid[crs]) {hasCentroids = true;if (olExtent.intersects(extent,@@ -323,7 +323,7 @@ export function dataUi(models, ui, config) {var updateSelection = function () {var $button = $('#wv-data-download-button');- var selected = loSize(model.selectedGranules);+ var selected = lodashSize(model.selectedGranules);if (selected > 0) {$button.button('enable');var totalSize = model.getSelectionSize();@@ -564,7 +564,7 @@ var dataUiDownloadListPanel = function (config, model) {$('#wv-data-selection').html(bodyText(selection));var bulkVisible = isBulkDownloadable() &&- loSize(model.selectedGranules) !== 0;+ lodashSize(model.selectedGranules) !== 0;if (bulkVisible) {$('wv-data-bulk-download-links').show();@@ -784,7 +784,7 @@ var dataUiDownloadListPanel = function (config, model) {};var bodyText = function () {- if (loSize(model.selectedGranules) === 0) {+ if (lodashSize(model.selectedGranules) === 0) {return '<br/><h3>Selection Empty</h3>';}var elements = [];