Select to view content in your preferred language

Simple Marker Symbol

1654
1
03-19-2017 08:52 AM
jaykapalczynski
Honored Contributor

This is a totally stupid question and I am drawing a complete blank...

How do I apply the Simple Marker Symbol to my Feature Layer?

var layer1 = new FeatureLayer("https://xxxx/arcgis/rest/services/Projects/AVL/MapServer/1", {
        mode: FeatureLayer.MODE_ONDEMAND,
});

var markerSymbol = new SimpleMarkerSymbol();
          markerSymbol.setPath(path);
       
          markerSymbol.setColor(new Color(color));
          markerSymbol.setOutline(null);
          markerSymbol.setSize("32");

layer1.set????? (markersymbol)
0 Kudos
1 Reply
thejuskambi
Frequent Contributor

You would have to use the FeatureLayer.setRenderer to achieve the result.

var renderer = new SimpleRenderer(symbol);

  featureLayer.setRenderer(renderer);

FeatureLayer | API Reference | ArcGIS API for JavaScript 3.20