+ Reply to Thread
Results 1 to 7 of 7

Thread: Cannot find FeatureLayerInfo.Get

  1. #1
    rouf baba
    Join Date
    Jun 2010
    Posts
    34
    Points
    0
    Answers Provided
    0


    0

    Question Cannot find FeatureLayerInfo.Get

    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

  2. #2
    Jennifer Nery

    Join Date
    May 2010
    Posts
    2,449
    Points
    289
    Answers Provided
    51


    0

    Default Re: Cannot find FeatureLayerInfo.Get

    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().

    Code:
                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();
    Code:
                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;
                        }
                    });
    Jennifer Nery
    Software Developer
    ArcGIS API for SL/WPF/WP7

  3. #3
    rouf baba
    Join Date
    Jun 2010
    Posts
    34
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cannot find FeatureLayerInfo.Get

    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

  4. #4
    Jennifer Nery

    Join Date
    May 2010
    Posts
    2,449
    Points
    289
    Answers Provided
    51


    0

    Default Re: Cannot find FeatureLayerInfo.Get

    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.
    Jennifer Nery
    Software Developer
    ArcGIS API for SL/WPF/WP7

  5. #5
    Paul Huppé
    Join Date
    Apr 2010
    Posts
    181
    Points
    3
    Answers Provided
    0


    0

    Default Re: Cannot find FeatureLayerInfo.Get

    Hi Jennifer,

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

    Paul

    Quote Originally Posted by jenniferdnery View Post
    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().

    Code:
                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();
    Code:
                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;
                        }
                    });

  6. #6
    Jennifer Nery

    Join Date
    May 2010
    Posts
    2,449
    Points
    289
    Answers Provided
    51


    0

    Default Re: Cannot find FeatureLayerInfo.Get

    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/sil...etDetails.html
    http://help.arcgis.com/en/webapi/sil...llDetails.html
    Last edited by jenniferdnery; 04-24-2012 at 11:59 AM.
    Jennifer Nery
    Software Developer
    ArcGIS API for SL/WPF/WP7

  7. #7
    Paul Huppé
    Join Date
    Apr 2010
    Posts
    181
    Points
    3
    Answers Provided
    0


    0

    Default Re: Cannot find FeatureLayerInfo.Get

    Thanks for the clarification.
    Cheers,
    Paul

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts