Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I did this:

dojo.connect(featureLayer, "onUpdateEnd", function() {
        var defaultSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,0,255]));
        dojo.forEach(this.graphics, function(graphic){
                graphic.setSymbol(defaultSymbol);
            });
});

I'm not satisfied with this solution because when I add new features to the layer they are added with a default symbol (black circle). Do you know how to set up symbols for the layer once and for all?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Use a renderer. In your case, a SimpleRenderer is probably ideal. There are several samples that demonstrate this...the Unique Value Renderer sample is one.

share|improve this answer
    
The links are broken :( –  twisig Aug 27 '13 at 13:45
    
@Julien fixed, thanks! –  Derek Swingley Aug 27 '13 at 20:20

Your Answer

 
discard

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.