after migrating to API 3.0 I somehow can't help noticing that there seems to be a bug in the createSwatch method for the SimpleLineSymbol (in API 2.5 there was some different bug - the returned swatch had wrong size - but never mind that now...)
If the symbol is not set on a graphic that is displayed on a map, createSwatch() only works correctly if the style of the symbol is set to 'solid'. The use case for me is to display the symbology of a feature in a TOC or a search results list, so putting an actual graphic on a map somewhere first to get to the symbol swatch is right out.
A little app to illustrate the problem - change the style in the dropdown to see what I mean:
We are aware of this bug. It will be fixed in the next version.
Also, note that the height(thickness) of the line in the swatch will be limited to the height passed in createSwatch(). So in the example above it will never be > 10.
We are aware of this bug. It will be fixed in the next version.
Also, note that the height(thickness) of the line in the swatch will be limited to the height passed in createSwatch(). So in the example above it will never be > 10.