'First, need to have an IFeatureWorkspace. Set your a new feature workspace from your existing workspace pFeatureWorkspace = pWorkspace 'Create a new feature layer object Dim pFlayer As New ESRI.ArcGIS.Carto.FeatureLayer 'Set the new object feature class to the open feature class pFlayer.FeatureClass = pFWkSpc.OpenFeatureClass("MyLayerName") 'You can't add a feature class to an IMap object, it has to be a an FDOGraphicsLayer object so... 'Create a new feature dataset object Dim pFeatureDataset As ESRI.ArcGIS.Geodatabase.IFeatureDataset 'set the object to the featurelayer dataset pFeatureDataset = pFlayer.FeatureClass.FeatureDataset 'create new fdographicslayer and fdographicslayerfactory objects Dim pFDOGrLayer As ESRI.ArcGIS.Carto.IFDOGraphicsLayer Dim pFDOGLFactory As ESRI.ArcGIS.Carto.IFDOGraphicsLayerFactory 'The factory must be 'new' pFDOGLFactory = New ESRI.ArcGIS.Carto.FDOGraphicsLayerFactory 'Then set the layer to the factory opengraphicslayer call with the feature workspace, feature dataset, and string name of your layer. pFDOGrLayer = pFDOGLFactory.OpenGraphicsLayer(pFeatureWorkspace, pFeatureDataset, "string name of layer") 'Finally add the fdographicslayer to the map. pMap.AddLayer(pFDOGrLayer)
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.