If you just want to show or hide some layers, you don't need to change the LayerDefinitions.You can set the LayerIds with the sublayers that you want to show.
Thank you for your advice. It turned out that the problem was much more complicated and required some changes in the way how layers are displayed and queries are made.
ESRI.ArcGIS.Client.Tasks.IdentifyParameters identifyParams = new IdentifyParameters() { Geometry = _clickPont, MapExtent = Map.Extent, Width = (int)Map.ActualWidth, Height = (int)Map.ActualHeight, SpatialReference = Map.SpatialReference, Tolerance = 10, LayerDefinitions = new[] { new LayerDefinition {LayerID = 0, Definition = "Magnitude = 6"}, new LayerDefinition {LayerID = 1, Definition = "Name = 'Paris'"} ......... } };
When I try to set the LayerIds I get an error that it is read only. Is there any way to set this?
That is the code that I used, and I don't get an error. However, identify still returns all layers for some reason.
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.