AnsweredAssumed Answered

FeatureLayer FeatureCollection Unique renderer

Question asked by glenreid on Jan 27, 2016
Latest reply on Jan 28, 2016 by glenreid

I have a feature layer created from a feature collection similar to the sample.  It works great:

 

var featureCollection = {
    "layerDefinition": null,
    "featureSet": {
        "features": [],
        "geometryType": "esriGeometryPoint"
    }
};

featureCollection.layerDefinition = {
    "geometryType": "esriGeometryPoint",
    "objectIdField": "ObjectID",
    "drawingInfo": {
        "renderer": {
            "type": "simple",
            "symbol": {
                "type": "esriPMS",
                "url": "resources/images/ship.png",
                "contentType": "image/png",
                "width": 16,
                "height": 16
            }
        }
    },
    "fields": [{
        "name": "ObjectID",
        "alias": "ObjectID",
        "type": "esriFieldTypeOID"
    }, {
        "name": "description",
        "alias": "Description",
        "type": "esriFieldTypeString"
    }, {
        "name": "title",
        "alias": "Title",
        "type": "esriFieldTypeString"
    }]
};

 

I'd now like to change this from a simple renderer to a unique value renderer.  Does anyone have an example that can get me started?

 

Thanks.

Outcomes