mkoneya

IGeoFeatureLayer.AnnotationProperties from ILabelingDescription

Discussion created by mkoneya on Dec 20, 2010
I trying to get the ILabelingDescription for an IMapServer3 layer and then use it for the AnnotationProperties of an IGeoFeatureLayer.     My code for the getting the ILabelDescription is shown below:

private ILabelingDescription GetLabelingInfo(int mapLayer)
        {
                IServerSymbolOutputOptions pSSOO = serverContext.CreateObject("esriCarto.ServerSymbolOutputOptions") as IServerSymbolOutputOptions;
                pSSOO.ConvertLabelExpressions = true;
                ILongArray longArray = serverContext.CreateObject("esriSystem.LongArray") as ILongArray;  //new LongArrayClass();
                longArray.Add(mapLayer);
                ILayerDrawingDescriptions lyrDrawDescs = null;
                lyrDrawDescs = (ILayerDrawingDescriptions)mapServer.GetDefaultLayerDrawingDescriptions(mapServer.DefaultMapName, longArray, pSSOO);
                ILayerDrawingDescription lyrDrawDesc = lyrDrawDescs.get_Element(0);
                IFeatureLayerDrawingDescription2 flDrawDesc = (IFeatureLayerDrawingDescription2)lyrDrawDesc;
                ILabelingDescription pLabelDescription = flDrawDesc.LabelingDescription;
                return pLabelDescription;
                }

How can I apply this ILabelingDescription to IGeoFeatureLayer.AnnotationProperties?     What casts are need?

Thanks,

Mele

Outcomes