Skip to content

Commit

Permalink
Merge pull request #393 from NASA-IMPACT/develop
Browse files Browse the repository at this point in the history
Release 1.4.1
  • Loading branch information
olafveerman authored Sep 1, 2020
2 parents 5c97152 + 92dc6ec commit 32e0ab0
Show file tree
Hide file tree
Showing 14 changed files with 677 additions and 144 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/graphics/content/indicators/caco.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions app/assets/scripts/components/common/layers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import population from './layer-population';
import nightlightsViirs from './layer-nightlights-viirs';
import nightlightsHd from './layer-nightlights-hd';
import detectionShip from './layer-detection-ship';
import slowdown from './layer-slowdown';
import waterChlorophyll from './layer-water-chlorophyll';
import waterSpm from './layer-water-spm';
import agriculture from './layer-agriculture';
Expand All @@ -21,6 +22,7 @@ const layers = [
nightlightsViirs,
nightlightsHd,
detectionShip,
slowdown,
waterChlorophyll,
waterSpm,
agriculture
Expand All @@ -29,13 +31,13 @@ const layers = [
export default layers;

const layersBySpotlight = {
be: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture'],
du: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture'],
gh: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture'],
la: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'detection-ship'],
sf: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'detection-ship', 'water-chlorophyll', 'water-spm'],
tk: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture'],
ny: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'detection-ship', 'water-chlorophyll', 'water-spm']
be: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown'],
du: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown'],
gh: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown'],
la: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'slowdown', 'detection-ship'],
sf: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'slowdown', 'detection-ship', 'water-chlorophyll', 'water-spm'],
tk: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs'],
ny: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown', 'detection-ship', 'water-chlorophyll', 'water-spm']
};

const layerOverridesBySpotlight = {
Expand Down
22 changes: 22 additions & 0 deletions app/assets/scripts/components/common/layers/layer-slowdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import config from '../../../config';

import { indicatorGroupColors } from '../../../styles/theme/theme.js';

export default {
id: 'slowdown',
name: 'Slowdown Proxy Maps',
type: 'raster',
source: {
type: 'raster',
tiles: [
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/slowdown_proxy_map/{spotlightId}.tif&resampling_method=bilinear&bidx=1%2C2%2C3%24`
]
},
paint: {
'raster-opacity': 0.9
},
exclusiveWith: ['agriculture', 'co2', 'co2-diff', 'gibs-population', 'car-count', 'nightlights-viirs', 'nightlights-hd', 'detection-ship', 'detection-multi', 'water-chlorophyll', 'water-spm'],
enabled: true,
swatch: indicatorGroupColors.economic,
info: 'Slowdown Proxy Maps show areas with the greatest reduction in car activity shaded in blue. Darker blues indicate areas of greater change.'
};
5 changes: 3 additions & 2 deletions app/assets/scripts/components/common/layers/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const layerTypes = {
},
show: (ctx, layerInfo) => {
const { mbMap } = ctx;
const { id, source } = layerInfo;
const { id, source, paint } = layerInfo;

if (mbMap.getSource(id)) {
mbMap.setLayoutProperty(id, 'visibility', 'visible');
Expand All @@ -182,7 +182,8 @@ export const layerTypes = {
{
id: id,
type: 'raster',
source: id
source: id,
paint: paint || {}
},
'admin-0-boundary-bg'
);
Expand Down
8 changes: 5 additions & 3 deletions app/assets/scripts/components/indicators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ import bm from './indicator-nightlights';
import population from './indicator-population';
import waterQuality from './indicator-water-quality';
import shipping from './indicator-shipping';
import caco from './indicator-cars-and-construction';

const indicators = [
caco,
co2,
agriculture,
bm,
no2,
co2,
population,
waterQuality,
shipping
shipping,
waterQuality
];

export default indicators;
Expand Down
Loading

0 comments on commit 32e0ab0

Please sign in to comment.