I need to display the style vlaues of the SimpleLine symbol in a combobox as svg graphics,
so that there's a visual cue for the different styles. Where can I get the corresponding stroke-dasharray values for the line styles like "DOT, LONGDASH" etc. Please advice.
<SVG width="100" height="50">
<path d={obj.d} stroke={obj.stroke} stroke-width={obj.width} stroke-opacity="1" stroke-dasharray="1,60" />
</SVG>
<SVG width="100" height="50">
<path d={obj1.d} stroke={obj1.stroke} stroke-width={obj1.width} stroke-opacity="1" stroke-dasharray="10.66,4,1.33,4" />
</SVG>
Priya,
I don't know what the exact stroke-dasharray is, but can you not just set a graphic in your map with that symbol and use developer tools to inspect the svg?
Yes Robert, I can reverse engineer the stroke-dasharray value using the dev tools.(its a long list though) Just wanted to ask in the forum, to see, if there's a class/property I can tap into , to obtain the same. (Symbology.getSVGProperties())
Priya,
Nope nothing like that exists.
If the goal is to provide a visual cue to the user based on symbols then you might want to check out the getShapeDescriptors(...) method. It provides the internal details about the GFX representation of the symbol. Note: GFX provides a browser independent abstraction of the symbol. Using the sample code provided in the api you can display the symbols in a dom node.
esri/symbols/jsonUtils | API Reference | ArcGIS API for JavaScript 3.18
Thanks John. Let me try this .