AnsweredAssumed Answered

Offset border on a polygon graphic

Question asked by wlanzaEsri on Sep 17, 2018
Latest reply on Sep 19, 2018 by rscheitlin

On my map I have a simple polygon feature layer (only layer on the map). A Graphic is created using a simpleFillSymbol  and the feature's geometry. The problem is, if i want polygon A to have a border color of red and adjoining polygon B to have a border color of Blue, where the polygons share a border it is of course the color of the last rendered graphic. (screenshot attached).

My initial thought was to use a CartographicLineSymbol for the border, but that is not possible with the SimpleFillSymbol. 

Is there a way/recommendation for how to offset the border to be inside each polygon using the JS API.

Changing the fill color is not an option as the specs call for the fill color to represent one attribute, and the border to represent another.


Thanks in advance.


Sample Code:

const feature = evt.graphic;
const graphicSymbol = new SimpleFillSymbol(SimpleLineSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([197,47,178]), 2), new Color([0, 0, 0, 0.2]));
const selectedPSAP_graphic = new Graphic(feature.geometry, graphicSymbol);