Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions configure/src/core/Maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,10 @@ const getComponent = (
{inlineHelp ? (
<>
{inner}
<Typography className={c.subtitle2}>
{com.description || ""}
</Typography>
<div
className={c.subtitle2}
dangerouslySetInnerHTML={{ __html: com.description || "" }}
></div>
</>
) : (
<Tooltip title={com.description || ""} placement="top" arrow>
Expand Down Expand Up @@ -708,9 +709,10 @@ const getComponent = (
{inlineHelp ? (
<>
{inner}
<Typography className={c.subtitle2}>
{com.description || ""}
</Typography>
<div
className={c.subtitle2}
dangerouslySetInnerHTML={{ __html: com.description || "" }}
></div>
</>
) : (
<Tooltip title={com.description || ""} placement="top" arrow>
Expand Down
4 changes: 2 additions & 2 deletions configure/src/metaconfigs/tab-coordinates-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
{
"field": "coordinates.coordmain",
"name": "Main Coordinate Type",
"description": "",
"description": "Sets which coordinates are shown by default in the bottom-right of the map.\n\t<strong>• LL</strong>: Longitude, Latitude\n\t<strong>• EN</strong>: Easting, Northing\n\t<strong>• CPROJ</strong>: Custom Projected (uses Projection tab)\n\t<strong>• SPROJ</strong>: Secondary Projected\n\t<strong>• RXY</strong>: Relative X, Y, (Z) in meters\n\t<strong>• SITE</strong>: Local Level Y, X, -Z",
"type": "dropdown",
"width": 2,
"width": 4,
"options": ["ll", "en", "cproj", "sproj", "rxy", "site"]
}
]
Expand Down
26 changes: 17 additions & 9 deletions configure/src/metaconfigs/tab-time-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@
"type": "checkbox",
"width": 3,
"defaultChecked": false
},
{
"field": "time.startInPointMode",
"name": "Start In Point Mode",
"description": "The Time UI begins in the Range Mode and allows users to bound by start and end times. Point Mode has users only control the end time and has start time implied by negative infinity.",
"type": "checkbox",
"width": 3,
"defaultChecked": false
}
]
},
Expand All @@ -50,7 +42,23 @@
"name": "Time Format",
"description": "The time format to be displayed on the Time UI. Uses D3 time format specifiers: <a target='_blank' href='https://github.com/d3/d3-time-format'>https://github.com/d3/d3-time-format</a>. Default: %Y-%m-%dT%H:%M:%SZ",
"type": "text",
"width": 12
"width": 6
},
{
"field": "time.liveByDefault",
"name": "Live Mode On By Default",
"description": "If enabled, the Time UI will start in Live (Present) mode.",
"type": "checkbox",
"width": 3,
"defaultChecked": false
},
{
"field": "time.startInPointMode",
"name": "Start In Point Mode",
"description": "The Time UI begins in the Range Mode and allows users to bound by start and end times. Point Mode has users only control the end time and has start time implied by negative infinity.",
"type": "checkbox",
"width": 3,
"defaultChecked": false
}
]
},
Expand Down
15 changes: 12 additions & 3 deletions src/essence/Ancillary/Coordinates.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ const Coordinates = {
!(
L_.configData.time &&
L_.configData.time.enabled === true &&
L_.configData.time.visible === true
(
L_.configData.time.visible === true ||
L_.configData.time.liveByDefault === true ||
L_.FUTURES.live === true
)
)
) {
$('#toggleTimeUI').css({ display: 'none' })
Expand Down Expand Up @@ -275,8 +279,13 @@ const Coordinates = {
if (
L_.configData.time &&
L_.configData.time.enabled === true &&
L_.configData.time.visible === true &&
L_.configData.time.initiallyOpen === true
(
L_.FUTURES.live === true ||
(L_.FUTURES.live == null && (
L_.configData.time.initiallyOpen === true ||
L_.configData.time.liveByDefault === true
))
)
) {
toggleTimeUI()
}
Expand Down
8 changes: 8 additions & 0 deletions src/essence/Ancillary/QueryURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var QueryURL = {

var startTime = this.getSingleQueryVariable('startTime')
var endTime = this.getSingleQueryVariable('endTime')
var live = this.getSingleQueryVariable('live')

if (urlSite !== false) {
L_.FUTURES.site = urlSite
Expand Down Expand Up @@ -176,6 +177,11 @@ var QueryURL = {
}
}

if (live !== false) {
const liveStr = (live + '').toLowerCase()
L_.FUTURES.live = liveStr === 'true' || liveStr === '1'
}

if (layersOn !== false || selected !== false) {
L_.FUTURES.customOn = true
// lists all the on layers
Expand Down Expand Up @@ -400,6 +406,8 @@ var QueryURL = {
urlAppendage += '&startTime=' + TimeControl.startTime
if (TimeControl.endTime)
urlAppendage += '&endTime=' + TimeControl.endTime
if (TimeControl.timeUI && typeof TimeControl.timeUI.now === 'boolean')
urlAppendage += '&live=' + (TimeControl.timeUI.now ? '1' : '0')
}

var url = encodeURI(urlAppendage)
Expand Down
36 changes: 32 additions & 4 deletions src/essence/Ancillary/TimeUI.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,7 @@
text-transform: capitalize;
color: var(--color-a5);
}
#mmgisTimeUIStartWrapper {
}
#mmgisTimeUIEndWrapper {
}
/* Start/End wrappers intentionally left for future styling hooks */
#mmgisTimeUIActionsLeft,
#mmgisTimeUIActionsRight {
background: var(--color-a);
Expand Down Expand Up @@ -296,6 +293,28 @@
transition: color 0.2s ease-out;
}

/* Live (Present) progress indicator */
#mmgisTimeUIPresent {
position: relative;
overflow: hidden;
margin: 3px;
width: 34px;
height: 34px;
}
#mmgisTimeUIPresentProgress {
position: absolute;
left: 0;
bottom: 0;
height: 3px;
width: 0;
background: #dcc565;
opacity: 0;
transition: width var(--live-duration, 1000ms) linear;
}
#mmgisTimeUIPresent.live #mmgisTimeUIPresentProgress {
opacity: 0.9;
}

#mmgisTimeUIFitTime:hover,
#mmgisTimeUIFitWindow:hover,
#mmgisTimeUIPresent:hover {
Expand Down Expand Up @@ -386,3 +405,12 @@
transition: opacity 0.2s ease-out;
z-index: -1;
}

/* Subtle tick flash on Live update (title text) */
#mmgisTimeUIEndWrapper > span.flash {
animation: mmgis-time-text-flash 0.35s ease-out;
}
@keyframes mmgis-time-text-flash {
0% { color: var(--color-p4); }
100% { color: var(--color-h); }
}
60 changes: 60 additions & 0 deletions src/essence/Ancillary/TimeUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const TimeUI = {
`</div>`,
`<div id="mmgisTimeUIPresent" class="mmgisTimeUIButton">`,
`<i class='mdi mdi-clock-end mdi-24px'></i>`,
`<div id="mmgisTimeUIPresentProgress"></div>`,
`</div>`,
`</div>`,
/*
Expand Down Expand Up @@ -443,6 +444,8 @@ const TimeUI = {
placement: 'top',
theme: 'blue',
})
// Initialize live progress duration on load
TimeUI._refreshLiveProgress()

if (L_.configData.time?.startInPointMode == true) {
TimeUI.modeIndex = TimeUI.modes.indexOf('Point')
Expand Down Expand Up @@ -516,6 +519,7 @@ const TimeUI = {
Dropy.init($('#mmgisTimeUIRateDropdown'), function (idx) {
TimeUI.intervalIndex = idx
TimeUI._refreshIntervals()
TimeUI._refreshLiveProgress()
})

// Interval Duration dropdown
Expand Down Expand Up @@ -730,6 +734,17 @@ const TimeUI = {
// Set modeIndex to 1/Point if a deeplink had an endtime but no starttime
else if (TimeUI.modeIndex != TimeUI._startingModeIndex)
TimeUI.changeMode(TimeUI._startingModeIndex)

// Enable live (present) based on deeplink override, else config default
const deeplinkLive = L_.FUTURES?.live
if (TimeUI.now !== true) {
if (deeplinkLive === true) {
TimeUI.toggleTimeNow(true)
} else if (deeplinkLive == null && L_.configData.time?.liveByDefault === true) {
TimeUI.toggleTimeNow(true)
}
}
TimeUI._refreshLiveProgress()
},
changeMode(idx) {
TimeUI.modeIndex = idx
Expand Down Expand Up @@ -865,6 +880,7 @@ const TimeUI = {
$('#mmgisTimeUIEndWrapper').css('cursor', 'inherit')
}
if (butDontActuallyPlay !== true) TimeUI._refreshIntervals()
TimeUI._refreshLiveProgress()
},
_updateExtentIndicator(forceStartTimestamp, forceEndTimestamp) {
if (TimeUI.play) return
Expand Down Expand Up @@ -917,6 +933,35 @@ const TimeUI = {
TimeUI.intervalValues[TimeUI.intervalIndex]
)
}
TimeUI._refreshLiveProgress()
},
_refreshLiveProgress() {
const dur = TimeUI.intervalValues[TimeUI.intervalIndex] || 1000
const present = $('#mmgisTimeUIPresent')
const progress = $('#mmgisTimeUIPresentProgress')
progress.css('--live-duration', `${dur}ms`)
if (TimeUI.now === true) {
present.addClass('live')
progress.css('opacity', 0.9)
TimeUI._restartLiveProgressTransition()
} else {
present.removeClass('live')
progress.css('opacity', 0)
progress.css('transition', 'none')
progress.css('width', '0')
}
},
_restartLiveProgressTransition() {
const dur = TimeUI.intervalValues[TimeUI.intervalIndex] || 1000
const progress = $('#mmgisTimeUIPresentProgress')
// Reset width to 0 without transition, then animate to 100%
progress.css('transition', 'none')
progress.css('width', '0')
// Force reflow to apply width reset before re-enabling transition
const _ = progress.get(0) && progress.get(0).offsetWidth
progress.css('transition', `width ${dur}ms linear`)
// Kick off the ramp
progress.css('width', '100%')
},
_loopTime(loopBackwards) {
const mode = TimeUI.modes[TimeUI.modeIndex]
Expand Down Expand Up @@ -1025,6 +1070,8 @@ const TimeUI = {
.css('color', 'white')
$('#mmgisTimeUIEnd').css('pointer-events', 'none')
$('#mmgisTimeUIEndWrapper').css('cursor', 'not-allowed')
// Rename label to Live Time
$('#mmgisTimeUIEndWrapper > span').text('Live Time')
TimeUI.now = true
TimeUI.togglePlay(false)
} else {
Expand All @@ -1034,6 +1081,8 @@ const TimeUI = {
.css('color', 'var(--color-a4)')
$('#mmgisTimeUIEnd').css('pointer-events', 'inherit')
$('#mmgisTimeUIEndWrapper').css('cursor', 'inherit')
// Restore label to Active Time
$('#mmgisTimeUIEndWrapper > span').text('Active Time')
TimeUI.now = false
}
TimeUI._refreshIntervals()
Expand Down Expand Up @@ -1310,6 +1359,17 @@ const TimeUI = {
TimeUI.setCurrentTime(parsedNow, disableChange)
//TimeUI._remakeTimeSlider(true)
TimeUI.endTempus.dates.setValue(parsedNow)
// Subtle tick flash indicator when live updates (title text)
if (TimeUI.now === true) {
const endLabel = $('#mmgisTimeUIEndWrapper > span')
endLabel.addClass('flash')
clearTimeout(TimeUI._flashTimeout)
TimeUI._flashTimeout = setTimeout(() => {
endLabel.removeClass('flash')
}, 600)
// Restart progress bar exactly on tick
TimeUI._restartLiveProgressTransition()
}
}
},
updateTimes(start, end, current) {
Expand Down
2 changes: 1 addition & 1 deletion src/essence/Basics/Layers_/Layers_.js
Original file line number Diff line number Diff line change
Expand Up @@ -3200,7 +3200,7 @@ const L_ = {
layerConfig.type === 'vector' &&
layerConfig.time.type === 'local' &&
layerConfig.time.endProp != null &&
layer != false &&
layer != false && layer != null &&
layer._sourceGeoJSON != null
) {
const filteredGeoJSON = JSON.parse(
Expand Down