Constructs a FeatureLayer object.
Syntax
Parameters
- id
- ID of the constructed FeatureLayer. This value must be unique if the constructed layer is to be added to a LayerCollection.
- dataset
- Dataset of the constructed FeatureLayer.
Example
The following example creates a new FeatureLayer using a new workspace and data set. It sets a renderer for the new layer, then adds the layer to the map.
C# | Copy Code |
---|
// Create a new FeatureLayer from a new ArcSDE workspace and data set
SdeWorkspace newSdeWS = new SdeWorkspace("sde_ws_1", "mySdeServer", "port:5151", "gis", "gis");
FeatureDataset newDataset = new FeatureDataset("MyInst.MyDB.Capitals", newSdeWS);
ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer dynamicLayer
= new ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer("capitals", newDataset);
// Assign a new renderer to the dynamic layer
SimpleRenderer capitalsRenderer = SimpleRenderer.Create(FeatureType.Point, System.Drawing.Color.Blue);
dynamicLayer.Renderer = capitalsRenderer;
// Add the dynamic layer to the map and draw the map
mapView.Layers.Add(dynamicLayer);
Image1.ImageUrl = mapView.Draw().Url; |
Visual Basic | Copy Code |
---|
' Create a new FeatureLayer from a new ArcSDE workspace and Data Set
Dim newSdeWS As New SdeWorkspace("sde_ws_1", "mySdeServer", "port:5151", "map", "map")
Dim newDataset As New FeatureDataset("MyInst.MyDB.Capitals", newSdeWS)
Dim dynamicLayer As New ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer("capitals", newDataset)
' Assign a new renderer to the dynamic layer
Dim capitalsRenderer As New SimpleRenderer.Create(FeatureType.Point, System.Drawing.Color.Blue)
dynamicLayer.Renderer = capitalsRenderer
' Add the dynamic layer to the map and draw the map
mapView.Layers.Add(dynamicLayer)
Image1.ImageUrl = mapView.Draw().Url |
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also