AnsweredAssumed Answered

Change png icon's background color dynamically for feature in feature layer

Question asked by soldous on Apr 25, 2017
Latest reply on Apr 28, 2017 by soldous



I have a point feature layer created from feature collection. As symbol for features in this FL is a png image with transaprent background. For every feature I have a html code of color readed from web service. Is it possible to change the background color for every feature using this hex code?  

I tried a pictureMarkerSymbol:

var symb = new PictureMarkerSymbol("images/trafLight.png",12,25);
var colorHex = Color.fromHex('#'+ String(item.color));
var geometry = new Point({"x":"-"+item.geometry.y,"y":"-"+item.geometry.x,"spatialReference":{"wkid":102067}});
var graphic = new Graphic(geometry);

The color doesn't change and if so I think it would change color of the border lines not the background color.