1

Can each group have different colors in javascript?

var blue = new PictureMarkerSymbol(picBaseUrl + "BluePin1LargeB.png", 32, 32).setOffset(0, 15);
var green = new PictureMarkerSymbol(picBaseUrl + "GreenPin1LargeB.png", 64, 64).setOffset(0, 15);
var red = new PictureMarkerSymbol(picBaseUrl + "RedPin1LargeB.png", 72, 72).setOffset(0, 15);
renderer.addBreak(0, 2, blue);
renderer.addBreak(0, 2, green);
renderer.addBreak(2, 1001, red);
var newcolor=[];
newcolor.push(blue);
newcolor.push(green);

Can I use both blue and and green in same render based on some case (if condition)?renderer.addBreak(0, 2, newcolor);

1 Answer 1

1

Yes you should be able to manage this by updatng the breaks as you need to.

looking at the esri ClassBreakRedered class here: https://developers.arcgis.com/javascript/jsapi/classbreaksrenderer-amd.html

You can clear existing breaks when you need to change the colours by calling clearBreaks() then re-add the breaks as you need with the new color e.g. green. Same colour for multiple breaks will be fine as well.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.