SVG stroke-dasharray value of the SimpleLine Symbol

1292
5
10-28-2016 11:19 AM
PriyaRam
Deactivated User

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>

Tags (1)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

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? 

0 Kudos
PriyaRam
Deactivated User

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())

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Priya,

   Nope nothing like that exists.

0 Kudos
JohnGrayson
Esri Regular Contributor

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 

PriyaRam
Deactivated User

Thanks John. Let me try this .

0 Kudos