Skip to content

Commit

Permalink
Merge pull request #453 from NASA-IMPACT/develop
Browse files Browse the repository at this point in the history
Release 0.8.1
  • Loading branch information
olafveerman authored Nov 11, 2020
2 parents 66e502d + 12e54f0 commit b082ffa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
File renamed without changes
13 changes: 6 additions & 7 deletions app/assets/scripts/components/common/layers/types.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { format, sub } from 'date-fns';
import bbox from '@turf/bbox';

import { utcDate } from '../../../utils/utils';

const dateFormats = {
monthOnly: 'MM',
month: 'yyyyMM',
Expand Down Expand Up @@ -208,8 +206,7 @@ export const layerTypes = {

// The source we're updating is not present.
if (!mbMap.getSource(vecId) || !mbMap.getSource(rastId)) return;

const formatDate = format(utcDate(date), dateFormats[layerInfo.timeUnit]);
const formatDate = format(date, dateFormats[layerInfo.timeUnit]);
const vectorData = source.data.replace('{date}', formatDate);
const rasterTiles = backgroundSource.tiles.map(tile => tile.replace('{date}', formatDate));

Expand Down Expand Up @@ -241,17 +238,19 @@ export const layerTypes = {
}
},
show: (ctx, layerInfo) => {
const { mbMap } = ctx;
const { id, source, backgroundSource, domain } = layerInfo;
const { props, mbMap } = ctx;
const { date } = props;
const { id, source, backgroundSource } = layerInfo;
const vecId = `${id}-vector`;
const rastId = `${id}-raster`;
if (!date) return;

const inferPaint = {
'line-color': '#f2a73a',
'line-opacity': 0.8,
'line-width': 2
};
const formatDate = format(utcDate(domain[domain.length - 1]), dateFormats[layerInfo.timeUnit]);
const formatDate = format(date, dateFormats[layerInfo.timeUnit]);
const vectorL = {
...source,
data: source.data.replace('{date}', formatDate)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "covid-dashboard",
"version": "1.8.0",
"version": "1.8.1",
"description": "Frontend application for the Covid Dashboard",
"repository": {
"type": "git",
Expand Down

0 comments on commit b082ffa

Please sign in to comment.