I have a map, taken offline from a webmap in ArcGIS Online. There is a layer in it with labels enabled. The label is fairly simple, just labelling off a single field. The labels display fine on the map.
Until, that is, I apply a very specific definitionExpression to the layer.
I can apply various different definition expressions and the labels continue to display fine. But if I try this particular expression the labels disappear:
"(CAST(strftime('%s', proposedRevisitDate) AS integer) >= 1501545600"
In this example, 'strftime' should take the value found in the 'proposedRevisitDate' field and return it as seconds since 1970, which should then be CAST as an integer, and then compared to the number on the right.
The SQL expression does appear to resolve ok, as the map layer is successfully filtered to the expected features. The only weird thing is that suddenly the labels disappear.
If I remove the definition expression, the labels reappear.
I have checked that layer.labelsEnabled is always true which it is.
I have checked that the label definition list model has a label definition, which it does.
In other words, nothing seems to change regarding the actual labels. I'm at a loss to explain why setting a definition expression should affect the display of the label.
Any ideas?
Cheers,
-Paul