Are LayerDefinitions supported on a joined field?

859
1
08-17-2010 12:05 PM
EricO_Neal
Deactivated User
Doesn't seem to work for me. Searched, but can't find much info....
0 Kudos
1 Reply
ChristopherHill
Deactivated User
Hello,

Here is an example of a  LayerDefinition being used with an Identify task. The layer is associated with its layerID and the filter is applied in the Definition property. Fields that can be filtered should be found on the meta data of the rest service. i.e. http://...MapServer/{LayerID}

// The parameters
   IdentifyParameters ip = new IdentifyParameters();
   ObservableCollection<LayerDefinition> layerDefs = new ObservableCollection<LayerDefinition>();
   layerDefs.Add(new LayerDefinition()
   {
    LayerID = 1,
    Definition = "NAME <> 'SomeValue1"
   });
   layerDefs.Add(new LayerDefinition()
   {
    LayerID = 25,
    Definition = "ZONE_CLASS <> 'SomeValue2'"
   });
   ip.Geometry = new MapPoint(7514349.00010499, 747972.249942258);
   ip.Height = 400;
   ip.Width = 400;
   ip.LayerDefinitions = layerDefs;
   ip.LayerOption = LayerOption.all;   
   ip.MapExtent = new Envelope(7650000, 640000, 7660000, 670000);   
   ip.Tolerance = 1;   

   // The task
   IdentifyTask task = new IdentifyTask(Url_v10);
   task.ExecuteCompleted += (s, e) =>
   {    
                                            //  results
   };
   task.Failed += FailedHandler;
   task.ExecuteAsync(ip);
0 Kudos