Hello. I am loading an ImageServiceLayer from a URL. Through the UI, I can add a Definition Query to it.
Through the SDK, I can see the previously created Definition Query. But I cannot add, edit or remove it in any way.
ImageServiceLayer ISL = null;
List<Layer> layers = map.GetLayersAsFlattenedList().ToList();
foreach (var layer in layers)
{
if (layer is ImageServiceLayer)
{
if (layer.Name == "ImageLayer")
ISL = layer as ImageServiceLayer;
}
}
if (ISL == null)
{
Uri uri = new Uri("...");
ISL = LayerFactory.Instance.CreateLayer(uri, map, 0) as ImageServiceLayer;
}
// If I have set a Definition Query through ArcGIS Pro UI, I can read it using ISL.DefinitionQuery
DefinitionQuery dq = new DefinitionQuery("QueryName", "OBJECTID = 5");
ISL.InsertDefinitionQuery(dq, true); // This does nothing.
I have tried a bunch of stuff but nothing seems to work. I can't edit an existing Definition Query, I can't remove it, I can't add a new one. Am I doing something wrong, or is it bugged?