Skip to content

Commit b082ffa

Browse files
authored
Merge pull request #453 from NASA-IMPACT/develop
Release 0.8.1
2 parents 66e502d + 12e54f0 commit b082ffa

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed
File renamed without changes.

app/assets/scripts/components/common/layers/types.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { format, sub } from 'date-fns';
22
import bbox from '@turf/bbox';
33

4-
import { utcDate } from '../../../utils/utils';
5-
64
const dateFormats = {
75
monthOnly: 'MM',
86
month: 'yyyyMM',
@@ -208,8 +206,7 @@ export const layerTypes = {
208206

209207
// The source we're updating is not present.
210208
if (!mbMap.getSource(vecId) || !mbMap.getSource(rastId)) return;
211-
212-
const formatDate = format(utcDate(date), dateFormats[layerInfo.timeUnit]);
209+
const formatDate = format(date, dateFormats[layerInfo.timeUnit]);
213210
const vectorData = source.data.replace('{date}', formatDate);
214211
const rasterTiles = backgroundSource.tiles.map(tile => tile.replace('{date}', formatDate));
215212

@@ -241,17 +238,19 @@ export const layerTypes = {
241238
}
242239
},
243240
show: (ctx, layerInfo) => {
244-
const { mbMap } = ctx;
245-
const { id, source, backgroundSource, domain } = layerInfo;
241+
const { props, mbMap } = ctx;
242+
const { date } = props;
243+
const { id, source, backgroundSource } = layerInfo;
246244
const vecId = `${id}-vector`;
247245
const rastId = `${id}-raster`;
246+
if (!date) return;
248247

249248
const inferPaint = {
250249
'line-color': '#f2a73a',
251250
'line-opacity': 0.8,
252251
'line-width': 2
253252
};
254-
const formatDate = format(utcDate(domain[domain.length - 1]), dateFormats[layerInfo.timeUnit]);
253+
const formatDate = format(date, dateFormats[layerInfo.timeUnit]);
255254
const vectorL = {
256255
...source,
257256
data: source.data.replace('{date}', formatDate)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "covid-dashboard",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "Frontend application for the Covid Dashboard",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)