Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add now parameter to persist in url if defined

Edward Plato56d3f713b636
diff --git a/web/js/location.js b/web/js/location.js
index 54e6accac..dbf3bdbd3 100644
--- a/web/js/location.js
+++ b/web/js/location.js
@@ -95,11 +95,28 @@ export const mapLocationToState = (state, location) => {
const getParameters = function(config, parameters) {
const now = config.pageLoadTime;
const nowMinusSevenDays = util.dateAdd(config.pageLoadTime, 'day', -7);
+ let TEST_NOW = '';
return {
p: {
stateKey: 'proj.id',
initialState: 'geographic'
},
+ now: {
+ stateKey: 'date.testNow',
+ initialState: undefined,
+ type: 'date',
+ options: {
+ serializeNeedsGlobalState: false,
+ setAsEmptyItem: true,
+ serialize: () => {
+ return TEST_NOW || undefined;
+ },
+ parse: str => {
+ TEST_NOW = str;
+ return tryCatchDate(str, now);
+ }
+ }
+ },
t: {
stateKey: 'date.selected',
initialState: now,