操作方法
可以将动态日期过滤器应用于 web 地图内的要素图层,以过滤指定日期的图层。 例如,可以使用过滤器来显示对图层进行的所有每日更新,而非每天手动更新 web 地图上的过滤器。
本文重点介绍了如何使用自定义 Arcade 表达式为要素图层创建动态日期过滤器的工作流。
Expects($feature, 'Date_Field_Name')
var time = -1
var units = 'days' //milliseconds, seconds, minutes, hours, days, months, years
var dateField = "Date_Field_Name"
var pastDate = DateAdd(Date(), time, units)
if($feature[dateField] > pastDate)
{
return 'Open'
}
Note: Change the first three variables to any desired value. The supported units are milliseconds, seconds, minutes, hours, days, months, and years. The dateField variable is the date field queried.
该地图显示了为要素图层创建的自定义动态日期过滤器。
文章 ID: 000027700
获取来自 ArcGIS 专家的帮助
下载 Esri 支持应用程序