Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public class FeatureRenderer |
Visual Basic (Declaration) |
---|
Public Class FeatureRenderer |
Remarks
Spatial vector data is can be added to a map using the FeatureLayer class. The FeatureRenderer class allows you to control the symbol used to draw FeatureLayer data on a map. The symbol type used for the renderer will depend on the geometry type of the FeatureLayer. If the FeatureLayer.Renderer property is not set, or is invalid for the geometry type, the FeatureLayer will be symbolized using an ArcGIS Explorer default symbol. The table below indicates the type of symbol that can be used for a specified geometry, and ArcGIS Explorer symbol defaults.
Geometry Type | Symbol Type |
---|---|
Point and Multipoint | Marker symbol, Default: Orange Stickpin |
Polyline | Line symbol, Default: Red Solid Line |
Polygon and Multipatch | Fill symbol, Default: Red Solid Fill |
The specific size and color of the symbol used can be changed by using the SetSymbol(Symbol) method, or retrieved using the GetSymbol()()() method.
Examples
//Create a DataSourceProperties object that holds connection information for road hazards in the forestry geodatabase DataSourceProperties featureLayerDataSourceProps = new DataSourceProperties(@"C:\Data\Forestry.gdb", "road_hazards"); //Create a feature layer referencing the road hazards FeatureLayer featureLayer = new FeatureLayer(featureLayerDataSourceProps); //Connect the layer to the data if (featureLayer.Connect()) { //If the connection was successful //Set hazards to use a red warning symbol featureLayer.Renderer.SetSymbol(Symbol.Marker.Transportation.WarningRed); //Specify that the symbols stand upright in 3D featureLayer.Renderer.BillboardSymbols = true; //Add layer to the map ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(featureLayer); }
'Create a DataSourceProperties object that holds connection information for road hazards in the forestry geodatabase Dim featureLayerDataSourceProps As New DataSourceProperties("C:\Data\Forestry.gdb", "road_hazards") 'Create a feature layer referencing the road hazards Dim featureLayer As New FeatureLayer(featureLayerDataSourceProps) 'Connect the layer to the data If featureLayer.Connect() Then 'If the connection was successful 'Set hazards to use a red warning symbol featureLayer.Renderer.SetSymbol(Symbol.Marker.Transportation.WarningRed) 'Specify that the symbols stand upright in 3D featureLayer.Renderer.BillboardSymbols = True 'Add layer to the map ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(featureLayer) End If