Repository for Ideas & Research
Open Source GIS, Hydrologic Modeling, Optimization

How to create a new feature layer using ArcObjects

IApplication app;
IMxDocument mxDoc;
IMap map;
IFeatureLayer fl;

// get the handle of the focus map
app = ArcMap.Application;
mxDoc = (IMxDocument)app.Document;
map = mxDoc.FocusMap;

// create a feature layer
fl = new FeatureLayerClass();
fl.Name = yourFeatureClass.AliasName;
fl.FeatureClass = yourFeatureClass;

// add the feature layer to the focus map

Wed Sep 6 08:37:47 2017 EDT by Huidae Cho
Parsing time: 0.010 seconds
XHTML . CSS . Powered by Uniqki!