In this topic
- Applying custom feature renderers to a layer
Custom feature renderers are simple to manage and usually require the dynamic-link library (DLL) containing the renderer class to be registered on each client PC.
The following are the main methods for applying a custom feature renderer to a layer:
- From the Symbology tab on the Layer Properties dialog box (ArcGIS Desktop only)
- From the client ArcObjects code
- Via a feature class extension
Applying the renderer through the Layer Properties dialog box requires you to implement a custom renderer property page registered to the ESRI Renderer Property Pages component category.
Applying your custom renderer with ArcObjects code is the usual method when you have not implemented a custom renderer property page. The following code example creates a point dispersal renderer object, then replaces an existing renderer in a particular layer:[Java]
//geoFeatureLayer is an interface pointer to the IGeoFeatureLayer //interface on a Feature Layer object. //Create the custom renderer. IDispersalRenderer myRenderer = new PointDispersalRenderer(); //You could set some properties here. //Now set the custom renderer into the feature layer. geoFeatureLayer.setRenderer(myRenderer); mxDocument.getActiveView().refresh(); mxDocument.updateContents();
A custom renderer without an accompanying property page can be applied programmatically.
The third way of applying a custom renderer to a layer is by writing a feature class extension. Your class extension must implement IFeatureClassExtension and IFeatureClassDraw.
To summarize, the globally unique identifier (GUID) of the FeatureClassExtension object is stored as an entry in the geodatabase. When the layer for this feature class draws, it looks to the feature class extension and uses the defined renderer (IFeatureClassDraw.CustomRenderer), which can be a custom renderer or one of the standard ESRI renderers. You can also associate a custom renderer property page through IFeatureClassDraw.CustomRendererPropertyPageCLSID. If you want to prevent users from changing the renderer, return true from IFeatureClassDraw.ExclusiveCustomRenderer.
Custom renderers can be applied by feature class extensions that implement IFeatureClassDraw.
See Also:Custom feature renderers
|Development licensing||Deployment licensing|
|ArcGIS for Desktop Basic||ArcGIS for Desktop Basic|
|ArcGIS for Desktop Standard||ArcGIS for Desktop Standard|
|ArcGIS for Desktop Advanced||ArcGIS for Desktop Advanced|
|Engine Developer Kit||Engine|