Using CreateSelectionLayer For ArcGIS Server

508
0
07-25-2013 03:13 PM
Muhammad_Abdul_HadiMuhammad_Ab
New Contributor II
Hi,
I am trying to create a layer by using selecting features. I am connecting to ArcGIS server using ESRI.ArcGIS.ADF.Connection.AGS.So far I have managed to get following code running. But it is not creating layer on the server. I do understand that I need to create this layer using server context but I am not able to find any examples other than CreateSelectionLayer.
What am I missing? Is there an alternate way to perform this?
        public bool CreateLayerFromSelection(IServerContext sc, string LayerName, bool UseCurrentSelection)
        {
            IFeatureLayerDefinition2 pFeatureLayerDef = (IFeatureLayerDefinition2)_featureLayer;
            IFeatureLayer pSelectionFeatureLayer = pFeatureLayerDef.CreateSelectionLayer(LayerName, UseCurrentSelection, "", "");
            _pMap.AddLayer(pSelectionFeatureLayer);
            return true;
        }
0 Kudos
0 Replies