6 Replies Latest reply on Apr 25, 2012 3:53 AM by phuppe

    Cannot find FeatureLayerInfo.Get

    babarouf
      How can I call this method to request the LayerInfo of feature Layer.

      Documentation states

      "Information about the feature layer. If null, can be obtained by calling FeatureLayerInfo.Get and listening to its Ready event. When the Ready event is fired, the LayerInfo property can be set to the FeatureLayerInfo that is now ready for use.  "

      Regards
      Rouf
        • Re: Cannot find FeatureLayerInfo.Get
          JNery-esristaff
          If you are using FeatureLayer, after the layer has successfully initialized, you can check FeatureLayer.LayerInfo property. If you are using ArcGISDynamicMapServiceLayer, you can use GetAllDetails or GetDetails().

                      var layer = new FeatureLayer() { Url = "http://servicesbeta2.esri.com/arcgis/rest/services/SF311/FeatureServer/0" };
                      layer.Initialized += (a, b) =>
                          {
                              if (layer.InitializationFailure == null)
                              {
                                  var info = layer.LayerInfo;
                                 
                              }
                          };
                      layer.Initialize();
          


                      var layer = new ArcGISDynamicMapServiceLayer() { Url = "http://servicesbeta2.esri.com/arcgis/rest/services/SF311/MapServer" };
                      layer.GetDetails(0, (a, b) =>
                          {
                              if (b == null)
                              {
                                  var info = a as FeatureLayerInfo;
                              }
                          });
          
          • Re: Cannot find FeatureLayerInfo.Get
            babarouf
            Thanks Jennifer,

            I am aware of the LayerInfo and GetDetails in Feature Layer and ArcgisDynamicLayer respectively.

            Actually, I have to get the Layername of the FeatureLayer in the layer collectionchanged event. Till that time Layer is not intilized so I need to get the Layerinfo by another request. After going through the api references. I found that FeatureLayerInfo.Get is used to request for the LayerInfo.

            I can request for the json but documentation mentions that there is a Get method to request for the layerinfo but I couldn't found one.


            Regards
            Rouf
            • Re: Cannot find FeatureLayerInfo.Get
              JNery-esristaff
              FeatureLayerInfo.Get() is an internal method to the API, which means you have no access to it. It is called to set FeatureLayer.LayerInfo. This property is ready once layer has initialized, therefore you can use Initialized event to retrieve it from layer as shown in the code snippet.
              • Re: Cannot find FeatureLayerInfo.Get
                phuppe
                Hi Jennifer,

                I am curious about your code below. Are "a" and "b" just dummy variables for "sender" and "args"?

                Paul

                If you are using FeatureLayer, after the layer has successfully initialized, you can check FeatureLayer.LayerInfo property. If you are using ArcGISDynamicMapServiceLayer, you can use GetAllDetails or GetDetails().

                            var layer = new FeatureLayer() { Url = "http://servicesbeta2.esri.com/arcgis/rest/services/SF311/FeatureServer/0" };
                            layer.Initialized += (a, b) =>
                                {
                                    if (layer.InitializationFailure == null)
                                    {
                                        var info = layer.LayerInfo;
                                       
                                    }
                                };
                            layer.Initialize();
                


                            var layer = new ArcGISDynamicMapServiceLayer() { Url = "http://servicesbeta2.esri.com/arcgis/rest/services/SF311/MapServer" };
                            layer.GetDetails(0, (a, b) =>
                                {
                                    if (b == null)
                                    {
                                        var info = a as FeatureLayerInfo;
                                    }
                                });
                
                • Re: Cannot find FeatureLayerInfo.Get
                  JNery-esristaff
                  Yes, that's correct. I should probably have called them (a) layerInfo/s and (b) exception for readability.

                  a,b were just parameter names that have the following type (see the method signature).
                  http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer~GetDetails.html
                  http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer~GetAllDetails.html
                  • Re: Cannot find FeatureLayerInfo.Get
                    phuppe
                    Thanks for the clarification.
                    Cheers,
                    Paul