origo
origo copied to clipboard
Feature style based on time
Is your feature request related to a problem? Please describe. When the data contains a datetime component it would be nice to be able change the style based on the datetime and specifically on the difference from now. A use case can be that there is data when a ski track is last preperaed and the style should have different colors f.e. if it was preperaed in the last 3 hours in green and last 24 hours in yellow.
Describe the solution you'd like I would like to setup a filter that takes a attribute and compares to how many seconds from now has past since the value specified.
[
{
"fill": {
"color": "rgba(170, 255, 0,1)"
},
"stroke": {
"color": "rgba(170, 255, 0,1)",
"width": 2
},
"filter": "[dateLastPreparation] DATETIMEDIFFNOW 10800",
"label": "Prep senaste 3 timmar",
"zIndex": 90
}
]
Describe alternatives you've considered More options to filter on datetime could be that you want to specify a specific date, month or year, but don't have any use case for that for now so leave it for future development.