Documentation on the StreamLayer.html.purgeOptions "ageReceived" option only says, "Specifies the maximum age of a feature in minutes since it arrived in the application. The features older than specified ageReceived will be removed."
Some layers which I subscribe to have a START attribute which gets updated when the feature being tracked gets updated. Currently I'm using that attribute to change the feature icon to grey when START is some delta from time now (x seconds). That seems to be working well. I have a second requirement to remove the feature from the map entirely when there has been no update for another interval (y minutes).
I initially assumed I could use the ageReceived option to direct the server to purge the features when there had been no updates for y minutes, but I am less confident of that the more I think about it. Maybe the server just counts the time from initial observation? If I'm receiving fresh observations on the feature all day long, I never want it to disappear. Maybe I'm going to have to keep track of features from within my client app and just remove them (or make them invisible) rather than trying to delegate it to the StreamServer.
I wish there was better documentation of that ageReceived option (and maybe the age option as well).
- How is ageReceived calculated, and does it update as the feature is updated?
- Is that integer minutes?
- Could I pass "1.5" and expect features to be purged after 90 seconds. (I'm guessing that float-type values either get rounded or, more likely, truncated, but I can wish...)
Thanks, in advance, for your thoughts.
(As an aside, it would be nice if there were some automated way to test the behavior of the ageReceived option, but I realize this is probably impossible, especially in a unit test where map resources (Maps, Layers, Features, etc.) are always statically mocked.)