Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to create a new renderer for a geo feature layer in ArcGIS 10. (My project is an based webservice) There is one solution I got from a tutorial that works, but only for a ISimpleRenderer

    // Create an ArcObjects color object with the color set to blue for use by the layer's renderer
    IRgbColor rgbColor = (IRgbColor)serverContext.CreateObject("esriDisplay.RgbColor");
    rgbColor.Red = 0;
    rgbColor.Green = 0;
    rgbColor.Blue = 210;

    // Set the symbol of the GeoFeatureLayer's renderer to use the color initialized above
    ISimpleRenderer aoSimpleRenderer = (ISimpleRenderer)geoFeatureLayer.Renderer;
    ISimpleLineSymbol simpleLineSymbol = (ISimpleLineSymbol)aoSimpleRenderer.Symbol;
    simpleLineSymbol.Color = (IColor)rgbColor;

that works fine, but only for the SimpleRenderer. What I need is the ClassBreaksRenderer. Now the problem is, that if I create a new Renderer (SimpleRenderer or ClassBreaksRenderer), set the properties and apply it to the geo feature class (geoFeatureLayer.Renderer = cRenderer as IFeatureRenderer) the map is empty and no features are rendered.

Someone has an idea?

share|improve this question

Did you remember to add the layer, refresh the map and update the contents?

e.g. (VB.NET in native Arc10)

pMxDoc.FocusMap.AddLayer pFLayer
share|improve this answer
Yes I did. In the webservice it's something like – Phil Jul 16 '11 at 15:17
aoMap.AddLayer(geoFeatureLayer as IFeatureLayer); mapServerObjects.RefreshServerObjects(); but it changed nothing... – Phil Jul 16 '11 at 15:28

This problem may be caused by several reasons. My advice is that you can delete the you code about rendering line by line to figure out the bug. Meanwhile, you can save the featured layer to a .lyr file and check it in ArcMap to see where the problem is. Following is the code for layer saving.

'saveFileName is the file name you choose to save, ending with suffix of ".lyr"'
If System.IO.File.Exists(saveFileName) Then 
End If

Dim layerFile As ILayerFile = New LayerFileClass()
'pGeoFeatureLayer is the target layer which you want to figure out the problem of no display'

In addition, there are two more parctical measures which may solve your problem.

  1. Enable the map to use symbol levels to draw the layer.

    Dim symbolLevels As ISymbolLevels symbolLevels = TryCast(pGeoFeatureLayer, ISymbolLevels) symbolLevels.UseSymbolLevels = True

  2. Check whether the symbol is accessible for current drawing element. For example, if your layer consists of polylines, SimpleFillSymbol, which is the common sample in offical guidelines about ClassBreakRender, may be not suitable for rendering. Just change it to SimpleLineSymbol, and you will see the magic! In my own work, this method worked!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.